mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-30 01:26:15 +02:00
Handle carriage return
This commit is contained in:
parent
ca9de88a51
commit
cc804d0dc6
1 changed files with 7 additions and 12 deletions
|
@ -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);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
currentLogLine.append(data, pos, newline - pos);
|
|
||||||
flushLine();
|
flushLine();
|
||||||
pos = newline + 1;
|
else
|
||||||
}
|
currentLogLine += c;
|
||||||
|
|
||||||
if (bzLogFile) {
|
if (bzLogFile) {
|
||||||
int err;
|
int err;
|
||||||
|
|
Loading…
Reference in a new issue