1
0
Fork 0
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:
Markus Schorn 2007-08-23 14:05:28 +00:00
parent 4490af21a1
commit c5bbb9ea48

View file

@ -98,9 +98,15 @@ public class ConsoleOutputSniffer {
String buffer = currentLine.toString();
int i = 0;
while ((i = buffer.indexOf('\n')) != -1) {
String line = buffer.substring(0, i).trim(); // get rid of any trailing \r
if (line.length() > 0)
// get rid of any trailing whitespace but keep leading whitespaces (bug 199245)
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);
}
buffer = buffer.substring(i + 1); // skip the \n and advance
}
currentLine.setLength(0);