mirror of
https://github.com/arduino/Arduino.git
synced 2025-02-26 20:54:22 +01:00
Windows: added comment to DoubleQuotedArgumentsOnWindowsCommandLine to explain the need for such a char replacement
This commit is contained in:
parent
f54851ecfa
commit
b10417505f
@ -1,8 +1,6 @@
|
|||||||
package processing.app.tools;
|
package processing.app.tools;
|
||||||
|
|
||||||
import org.apache.commons.exec.CommandLine;
|
import org.apache.commons.exec.CommandLine;
|
||||||
import processing.app.BaseNoGui;
|
|
||||||
import processing.app.Platform;
|
|
||||||
import processing.app.helpers.OSUtils;
|
import processing.app.helpers.OSUtils;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@ -23,6 +21,11 @@ public class DoubleQuotedArgumentsOnWindowsCommandLine extends CommandLine {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommandLine addArgument(String argument, boolean handleQuoting) {
|
public CommandLine addArgument(String argument, boolean handleQuoting) {
|
||||||
|
// Brutal hack to workaround windows command line parsing.
|
||||||
|
// http://stackoverflow.com/questions/5969724/java-runtime-exec-fails-to-escape-characters-properly
|
||||||
|
// http://msdn.microsoft.com/en-us/library/a1y7w461.aspx
|
||||||
|
// http://bugs.sun.com/view_bug.do?bug_id=6468220
|
||||||
|
// http://bugs.sun.com/view_bug.do?bug_id=6518827
|
||||||
if (argument.contains("\"") && OSUtils.isWindows()) {
|
if (argument.contains("\"") && OSUtils.isWindows()) {
|
||||||
argument = argument.replace("\"", "\\\"");
|
argument = argument.replace("\"", "\\\"");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user