mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-08 02:06:01 +02:00
bug 261976: Console does NOT display quoted command line options.
This commit is contained in:
parent
a8f5e29bcb
commit
2137716456
1 changed files with 14 additions and 2 deletions
|
@ -254,11 +254,23 @@ public class CommandLauncher implements ICommandLauncher {
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("nls")
|
||||||
protected void printCommandLine(OutputStream os) {
|
protected void printCommandLine(OutputStream os) {
|
||||||
if (os != null) {
|
if (os != null) {
|
||||||
String cmd = getCommandLine(getCommandArgs());
|
StringBuffer buf = new StringBuffer();
|
||||||
|
if (fCommandArgs != null) {
|
||||||
|
for (String commandArg : getCommandArgs()) {
|
||||||
|
if (commandArg.contains(" ") || commandArg.contains("\"") || commandArg.contains("\\")) {
|
||||||
|
commandArg = '"' + commandArg.replaceAll("\\\\", "\\\\\\\\").replaceAll("\"", "\\\\\"") + '"';
|
||||||
|
}
|
||||||
|
buf.append(commandArg);
|
||||||
|
buf.append(' ');
|
||||||
|
}
|
||||||
|
buf.append(lineSeparator);
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
os.write(cmd.getBytes());
|
os.write(buf.toString().getBytes());
|
||||||
os.flush();
|
os.flush();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// ignore;
|
// ignore;
|
||||||
|
|
Loading…
Add table
Reference in a new issue