From 56008cedc6068d6b6e47c4d724e766525ae858b6 Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Mon, 11 Apr 2022 16:40:45 -0400 Subject: remove extra newline when no dir operands --- ls.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ls.c b/ls.c index 8ec0ae2..0f7d498 100644 --- a/ls.c +++ b/ls.c @@ -589,7 +589,9 @@ int main(int argc, char *argv[]) if (nfiles > 0) { qsort(operands, nfiles, sizeof(operands[0]), ls_compare_files); ls_print(nfiles, operands); - printf("\n"); + if (op->path) { + printf("\n"); + } } while (op->path != NULL) { -- cgit v1.2.1