Skip to content

Commit

Permalink
This should fix test_pid by only using shell for special chars.
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Apr 23, 2015
1 parent 8d8842b commit ae86ae7
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions core/src/main/java/org/jruby/util/ShellLauncher.java
Expand Up @@ -723,7 +723,7 @@ private static Process popenShared(Ruby runtime, IRubyObject[] strings) throws I
}

private static Process popenShared(Ruby runtime, IRubyObject[] strings, Map env) throws IOException {
return popenShared(runtime, strings, env, false);
return popenShared(runtime, strings, env, true);
}

private static Process popenShared(Ruby runtime, IRubyObject[] strings, Map env, boolean addShell) throws IOException {
Expand All @@ -749,10 +749,9 @@ private static Process popenShared(Ruby runtime, IRubyObject[] strings, Map env,

String[] args = parseCommandLine(runtime.getCurrentContext(), runtime, strings);
LaunchConfig lc = new LaunchConfig(runtime, strings, false);
boolean useShell = lc.shouldRunInShell();
boolean useShell = Platform.IS_WINDOWS ? lc.shouldRunInShell() : false;
if (addShell) for (String arg : args) useShell |= shouldUseShell(arg);

// CON: popen is a case where I think we should just always shell out.

if (strings.length == 1) {
if (useShell) {
// single string command, pass to sh to expand wildcards
Expand Down

0 comments on commit ae86ae7

Please sign in to comment.