From 6beea7f8170385d1ea985c96198c6fbd6f2f9dbe Mon Sep 17 00:00:00 2001 From: apio Date: Tue, 2 May 2023 11:00:28 +0200 Subject: [PATCH] ls: Avoid printing an empty line when a directory is empty --- apps/ls.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/ls.cpp b/apps/ls.cpp index d5f5aeef..1f62f590 100644 --- a/apps/ls.cpp +++ b/apps/ls.cpp @@ -49,7 +49,7 @@ Result luna_main(int argc, char** argv) if (!long_list) { auto list = TRY(String::join(files, " "_sv)); - os::println("%s", list.chars()); + if (!list.is_empty()) os::println("%s", list.chars()); } else {