Merge pull request #2514 from AJCStriker/patch-1
core: add invalid character replacement in Which util
This commit is contained in:
commit
5150817b3a
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue