summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2020-07-06 00:55:06 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2020-07-06 00:55:06 +0000
commitc3cc4803f315c77e9c28de5cd68b11a918d0745e (patch)
tree102d76704ff7ad7fea2b861dab671d4d814fc19e /bin
parent8ae9abf48d9711974aed8f310cf550932450d908 (diff)
Always print the directory name in -R mode; matches historical behavior.
Previously, our ls would only print the directory name when listing more than one directory, which is the correct behavior for non-recursive ls but not for -R mode. OK deraadt@
Diffstat (limited to 'bin')
-rw-r--r--bin/ls/ls.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/ls/ls.c b/bin/ls/ls.c
index d8fb2e2182c..75fcd0815ab 100644
--- a/bin/ls/ls.c
+++ b/bin/ls/ls.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ls.c,v 1.52 2020/07/06 00:51:51 millert Exp $ */
+/* $OpenBSD: ls.c,v 1.53 2020/07/06 00:55:05 millert Exp $ */
/* $NetBSD: ls.c,v 1.18 1996/07/09 09:16:29 mycroft Exp $ */
/*
@@ -381,7 +381,7 @@ traverse(int argc, char *argv[], int options)
*/
if (output)
(void)printf("\n%s:\n", p->fts_path);
- else if (argc > 1) {
+ else if (f_recursive || argc > 1) {
(void)printf("%s:\n", p->fts_path);
output = 1;
}