Userland: Fix broken newlines in 'sort'

This commit is contained in:
Ben Wiederhake 2021-01-19 22:59:34 +01:00 committed by Andreas Kling
parent ab07a713bf
commit 9c8efcd17e
Notes: sideshowbarker 2024-07-18 23:02:29 +09:00

View file

@ -53,7 +53,7 @@ int main([[maybe_unused]] int argc, [[maybe_unused]] char** argv)
}
if (buflen == -1)
break;
lines.append(buffer);
lines.append({ buffer, AK::ShouldChomp::Chomp });
}
quick_sort(lines, [](auto& a, auto& b) {
@ -62,6 +62,7 @@ int main([[maybe_unused]] int argc, [[maybe_unused]] char** argv)
for (auto& line : lines) {
fputs(line.characters(), stdout);
fputc('\n', stdout);
}
return 0;