Skip to content

Commit b104175

Browse files
author
Federico Fissore
committed
Windows: added comment to DoubleQuotedArgumentsOnWindowsCommandLine to explain the need for such a char replacement
1 parent f54851e commit b104175

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

arduino-core/src/processing/app/tools/DoubleQuotedArgumentsOnWindowsCommandLine.java

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package processing.app.tools;
22

33
import org.apache.commons.exec.CommandLine;
4-
import processing.app.BaseNoGui;
5-
import processing.app.Platform;
64
import processing.app.helpers.OSUtils;
75

86
import java.io.File;
@@ -23,6 +21,11 @@ public DoubleQuotedArgumentsOnWindowsCommandLine(CommandLine other) {
2321

2422
@Override
2523
public CommandLine addArgument(String argument, boolean handleQuoting) {
24+
// Brutal hack to workaround windows command line parsing.
25+
// http://stackoverflow.com/questions/5969724/java-runtime-exec-fails-to-escape-characters-properly
26+
// http://msdn.microsoft.com/en-us/library/a1y7w461.aspx
27+
// http://bugs.sun.com/view_bug.do?bug_id=6468220
28+
// http://bugs.sun.com/view_bug.do?bug_id=6518827
2629
if (argument.contains("\"") && OSUtils.isWindows()) {
2730
argument = argument.replace("\"", "\\\"");
2831
}

0 commit comments

Comments
 (0)