Add invalid character replacement

This fixes the bug seen here:
http://pastebin.com/QzWQQndK

Which would generate an Argument Error causing "vagrant up" and other such commands to fail.
This commit is contained in:
AJCStriker 2013-11-20 01:44:49 +00:00
parent 4883ece9a1
commit a567e658c8
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