fixed pipe output sometimes being split on non-existing newlines

This commit is contained in:
isanae
2020-07-13 10:20:46 -04:00
parent c003e2700e
commit dddc5f1e7d
2 changed files with 11 additions and 6 deletions
+2
View File
@@ -706,6 +706,8 @@ void process::on_completed()
code_ = 0xffff;
}
read_pipes(false);
for (;;)
{
read_pipes(true);
+9 -6
View File
@@ -137,14 +137,17 @@ private:
}
}
if (line.empty() && finished)
if (line.empty())
{
line = {
reinterpret_cast<const CharT*>(bytes.data() + byte_offset),
size - byte_offset
};
if (finished)
{
line = {
reinterpret_cast<const CharT*>(bytes.data() + byte_offset),
size - byte_offset
};
byte_offset = bytes.size();
byte_offset = bytes.size();
}
}
else
{