Created
November 8, 2010 21:52
-
-
Save enebo/668334 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git diff src | |
git diff src | |
diff --git a/src/org/jruby/RubyIO.java b/src/org/jruby/RubyIO.java | |
index e1b77a0..a78152c 100644 | |
--- a/src/org/jruby/RubyIO.java | |
+++ b/src/org/jruby/RubyIO.java | |
@@ -3425,16 +3425,10 @@ public class RubyIO extends RubyObject { | |
IRubyObject cmdObj = null; | |
if (Platform.IS_WINDOWS) { | |
String[] tokens = args[0].convertToString().toString().split(" ", 2); | |
- if (tokens.length > 1) { | |
- cmdObj = new RubyString(runtime, (RubyClass) recv, | |
- (tokens[0].replace('/', '\\') + ' ' + tokens[1])); | |
- } | |
- else { | |
- cmdObj = new RubyString(runtime, (RubyClass) recv, | |
- (tokens[0].replace('/','\\'))); | |
- } | |
- } | |
- else { | |
+ String commandString = tokens[0].replace('/', '\\') + | |
+ (tokens.length > 1 ? ' ' + tokens[1] : ""); | |
+ cmdObj = runtime.newString(commandString); | |
+ } else { | |
cmdObj = args[0].convertToString(); | |
} | |
runtime.checkSafeString(cmdObj); | |
@@ -3453,7 +3447,7 @@ public class RubyIO extends RubyObject { | |
} | |
ModeFlags modes = new ModeFlags(mode); | |
- | |
+ | |
ShellLauncher.POpenProcess process = ShellLauncher.popen(runtime, cmdObj, modes); | |
// Yes, this is gross. java.lang.Process does not appear to be guaranteed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment