summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2022-04-11 16:40:45 -0400
committerJakob Kaivo <jkk@ung.org>2022-04-11 16:40:45 -0400
commit56008cedc6068d6b6e47c4d724e766525ae858b6 (patch)
treea23f72a5d842b9d428947168c772d4d6cb121865
parent5110660d1762483a818a3bc4326fbfece57dd146 (diff)
remove extra newline when no dir operands
-rw-r--r--ls.c4
1 files changed, 3 insertions, 1 deletions
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) {