diff options
author | 2020-07-06 00:55:05 +0000 | |
---|---|---|
committer | 2020-07-06 00:55:05 +0000 | |
commit | b3b446690c0d2beb778cd8472a7add58e18c6b7c (patch) | |
tree | fdd0c7371ed8b27f3b8f7c04ff371ea5ed10a5e8 | |
parent | Fix skipping of directories that begin with a '.' in -R mode. (diff) | |
download | wireguard-openbsd-b3b446690c0d2beb778cd8472a7add58e18c6b7c.tar.xz wireguard-openbsd-b3b446690c0d2beb778cd8472a7add58e18c6b7c.zip |
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@
-rw-r--r-- | bin/ls/ls.c | 4 |
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; } |