Handle carriage return

This commit is contained in:
Eelco Dolstra 2016-04-25 19:18:28 +02:00
parent ca9de88a51
commit cc804d0dc6

View file

@ -2935,18 +2935,13 @@ void DerivationGoal::handleChildOutput(int fd, const string & data)
return; return;
} }
for (size_t pos = 0; true; ) { for (auto c : data)
auto newline = data.find('\n', pos); if (c == '\r')
currentLogLine.clear(); // FIXME: not quite right
if (newline == std::string::npos) { else if (c == '\n')
currentLogLine.append(data, pos, std::string::npos); flushLine();
break; else
} currentLogLine += c;
currentLogLine.append(data, pos, newline - pos);
flushLine();
pos = newline + 1;
}
if (bzLogFile) { if (bzLogFile) {
int err; int err;