| 1 |
package processing.app.tools; |
| 2 |
|
| 3 |
import org.apache.commons.exec.CommandLine; |
| 4 |
import processing.app.helpers.OSUtils; |
| 5 |
|
| 6 |
import java.io.File; |
| 7 |
|
| 8 |
public class DoubleQuotedArgumentsOnWindowsCommandLine extends CommandLine { |
| 9 |
|
| 10 |
public DoubleQuotedArgumentsOnWindowsCommandLine(String executable) { |
| 11 |
super(executable); |
| 12 |
} |
| 13 |
|
| 14 |
public DoubleQuotedArgumentsOnWindowsCommandLine(File executable) { |
| 15 |
super(executable); |
| 16 |
} |
| 17 |
|
| 18 |
public DoubleQuotedArgumentsOnWindowsCommandLine(CommandLine other) { |
| 19 |
super(other); |
| 20 |
} |
| 21 |
|
| 22 |
@Override |
| 23 |
public CommandLine addArgument(String argument, boolean handleQuoting) { |
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
if (argument.contains("\"") && OSUtils.isWindows()) { |
| 30 |
argument = argument.replace("\"", "\\\""); |
| 31 |
} |
| 32 |
|
| 33 |
return super.addArgument(argument, handleQuoting); |
| 34 |
} |
| 35 |
} |