mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Fix for 199245, scanner discovery and multi-line commands.
This commit is contained in:
parent
4490af21a1
commit
c5bbb9ea48
1 changed files with 8 additions and 2 deletions
|
@ -98,9 +98,15 @@ public class ConsoleOutputSniffer {
|
||||||
String buffer = currentLine.toString();
|
String buffer = currentLine.toString();
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while ((i = buffer.indexOf('\n')) != -1) {
|
while ((i = buffer.indexOf('\n')) != -1) {
|
||||||
String line = buffer.substring(0, i).trim(); // get rid of any trailing \r
|
// get rid of any trailing whitespace but keep leading whitespaces (bug 199245)
|
||||||
if (line.length() > 0)
|
int end= i;
|
||||||
|
while(end > 0 && buffer.charAt(end-1) <= ' ') { // see String.trim()
|
||||||
|
end--;
|
||||||
|
}
|
||||||
|
if (end > 0) {
|
||||||
|
String line = buffer.substring(0, end);
|
||||||
processLine(line);
|
processLine(line);
|
||||||
|
}
|
||||||
buffer = buffer.substring(i + 1); // skip the \n and advance
|
buffer = buffer.substring(i + 1); // skip the \n and advance
|
||||||
}
|
}
|
||||||
currentLine.setLength(0);
|
currentLine.setLength(0);
|
||||||
|
|
Loading…
Add table
Reference in a new issue