diff --git a/arduino-core/src/processing/app/debug/Compiler.java b/arduino-core/src/processing/app/debug/Compiler.java index 83af66470..e1c2e2fb2 100644 --- a/arduino-core/src/processing/app/debug/Compiler.java +++ b/arduino-core/src/processing/app/debug/Compiler.java @@ -54,7 +54,7 @@ import processing.app.preproc.PdePreprocessor; import processing.app.legacy.PApplet; import processing.app.packages.LegacyUserLibrary; import processing.app.packages.UserLibrary; -import processing.app.tools.ArgumentsWithSpaceAwareCommandLine; +import processing.app.tools.DoubleQuotedArgumentsOnWindowsCommandLine; public class Compiler implements MessageConsumer { @@ -723,7 +723,7 @@ public class Compiler implements MessageConsumer { } }); - CommandLine commandLine = new ArgumentsWithSpaceAwareCommandLine(command[0]); + CommandLine commandLine = new DoubleQuotedArgumentsOnWindowsCommandLine(command[0]); for (int i = 1; i < command.length; i++) { commandLine.addArgument(command[i], false); } diff --git a/arduino-core/src/processing/app/tools/ArgumentsWithSpaceAwareCommandLine.java b/arduino-core/src/processing/app/tools/DoubleQuotedArgumentsOnWindowsCommandLine.java similarity index 52% rename from arduino-core/src/processing/app/tools/ArgumentsWithSpaceAwareCommandLine.java rename to arduino-core/src/processing/app/tools/DoubleQuotedArgumentsOnWindowsCommandLine.java index 775b4c2b0..15c793a3d 100644 --- a/arduino-core/src/processing/app/tools/ArgumentsWithSpaceAwareCommandLine.java +++ b/arduino-core/src/processing/app/tools/DoubleQuotedArgumentsOnWindowsCommandLine.java @@ -7,24 +7,24 @@ import processing.app.helpers.OSUtils; import java.io.File; -public class ArgumentsWithSpaceAwareCommandLine extends CommandLine { +public class DoubleQuotedArgumentsOnWindowsCommandLine extends CommandLine { - public ArgumentsWithSpaceAwareCommandLine(String executable) { + public DoubleQuotedArgumentsOnWindowsCommandLine(String executable) { super(executable); } - public ArgumentsWithSpaceAwareCommandLine(File executable) { + public DoubleQuotedArgumentsOnWindowsCommandLine(File executable) { super(executable); } - public ArgumentsWithSpaceAwareCommandLine(CommandLine other) { + public DoubleQuotedArgumentsOnWindowsCommandLine(CommandLine other) { super(other); } @Override public CommandLine addArgument(String argument, boolean handleQuoting) { - if (argument.contains(" ") && OSUtils.isWindows()) { - argument = argument.replaceAll("\"", "").replaceAll("'", ""); + if (argument.contains("\"") && OSUtils.isWindows()) { + argument = argument.replace("\"", "\\\""); } return super.addArgument(argument, handleQuoting);