Permalink
Browse files

Merge pull request #49 from rubys/master

Fix issue 48 for me
  • Loading branch information...
josh committed Sep 20, 2011
2 parents 1332be0 + a7cdbfc commit 7c903fa9462784433310870809053fc33bb64d93
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/execjs/external_runtime.rb
@@ -122,7 +122,7 @@ def runner_source
end
def exec_runtime(filename)
- output = sh("#{shell_escape(@binary, filename)} 2>&1")
+ output = sh("#{shell_escape(*(@binary.split(' ') << filename))} 2>&1")
if $?.success?
output
else
@@ -182,7 +182,8 @@ def sh(command)
if ExecJS.windows?
def shell_escape(*args)
- args.map { |arg| arg.inspect }.join(" ")
+ # see http://technet.microsoft.com/en-us/library/cc723564.aspx#XSLTsection123121120120
+ args.map { |arg| arg.gsub(/([&|()<>^ "])/,'^\1') }.join(" ")
end
else
def shell_escape(*args)

0 comments on commit 7c903fa

Please sign in to comment.