Merge pull request #2514 from AJCStriker/patch-1

core: add invalid character replacement in Which util
This commit is contained in:
Mitchell Hashimoto 2013-11-21 14:58:22 -08:00
commit 5150817b3a
1 changed files with 1 additions and 1 deletions

View File

@ -29,7 +29,7 @@ module Vagrant
exts = ENV['PATHEXT'].split(';')
end
ENV['PATH'].split(File::PATH_SEPARATOR).each do |path|
ENV['PATH'].encode('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '').split(File::PATH_SEPARATOR).each do |path|
exts.each do |ext|
exe = "#{path}#{File::SEPARATOR}#{cmd}#{ext}"
return exe if File.executable? exe