From 9c8efcd17e823ace731070595348fb32dc79c944 Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Tue, 19 Jan 2021 22:59:34 +0100 Subject: [PATCH] Userland: Fix broken newlines in 'sort' --- Userland/Utilities/sort.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Userland/Utilities/sort.cpp b/Userland/Utilities/sort.cpp index 351d1960574..34b528f96b0 100644 --- a/Userland/Utilities/sort.cpp +++ b/Userland/Utilities/sort.cpp @@ -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;