mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +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;
|
||||
}
|
||||
|
||||
@SuppressWarnings("nls")
|
||||
protected void printCommandLine(OutputStream os) {
|
||||
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 {
|
||||
os.write(cmd.getBytes());
|
||||
os.write(buf.toString().getBytes());
|
||||
os.flush();
|
||||
} catch (IOException e) {
|
||||
// ignore;
|
||||
|
|
Loading…
Add table
Reference in a new issue