Skip to content

Commit

Permalink
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions core/src/main/java/org/jruby/util/ShellLauncher.java
Original file line number Diff line number Diff line change
@@ -732,6 +732,13 @@ private static Process popenShared(Ruby runtime, IRubyObject[] strings, Map env,
File pwd = new File(runtime.getCurrentDirectory());

try {
// Peel off env hash, if given
IRubyObject envHash = null;
if (env == null && strings.length > 0 && !(envHash = TypeConverter.checkHashType(runtime, strings[0])).isNil()) {
strings = Arrays.copyOfRange(strings, 1, strings.length);
env = (Map)envHash;
}

String[] args = parseCommandLine(runtime.getCurrentContext(), runtime, strings);
boolean useShell = false;
if (addShell) for (String arg : args) useShell |= shouldUseShell(arg);

0 comments on commit 66b2905

Please sign in to comment.