From a567e658c845e2cf82585979dc78dd1e66214a0e Mon Sep 17 00:00:00 2001 From: AJCStriker Date: Wed, 20 Nov 2013 01:44:49 +0000 Subject: [PATCH] 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. --- lib/vagrant/util/which.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vagrant/util/which.rb b/lib/vagrant/util/which.rb index 090d84010..9a7ba5b23 100644 --- a/lib/vagrant/util/which.rb +++ b/lib/vagrant/util/which.rb @@ -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