From 3965fcc4841162fff95cf01a104d30297f981b2f Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 21 Jul 2019 09:26:47 +0200 Subject: [PATCH] ls: Don't print an empty line if there were no files to show. Fixes #352. --- Userland/ls.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Userland/ls.cpp b/Userland/ls.cpp index 9c2c690c8e..689c16dfee 100644 --- a/Userland/ls.cpp +++ b/Userland/ls.cpp @@ -284,7 +284,8 @@ int do_file_system_object_short(const char* path) printed_on_row = 0; } } - printf("\n"); + if (printed_on_row) + printf("\n"); return 0; }