mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-17 06:52:18 +01:00
Windows: Compiler wasn't supplying Windows command line with the correct double quotes
This commit is contained in:
parent
d805fb4e1f
commit
f54851ecfa
@ -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);
|
||||
}
|
||||
|
@ -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);
|
Loading…
x
Reference in New Issue
Block a user