aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2021-09-19 17:08:51 -0700
committerBruce Hill <bruce@bruce-hill.com>2021-09-19 17:08:51 -0700
commit42c75cfd7372042c5e7de2d8cd83ac064035c449 (patch)
treea36721073440b1e6faa40d0a1dd605bba6b56d16
parent393778ffabecc8fabadc72b9f0bce5340863406d (diff)
Fix for single-arg when it's a directory
-rw-r--r--bp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bp.c b/bp.c
index b55b236..0ed2c40 100644
--- a/bp.c
+++ b/bp.c
@@ -548,7 +548,7 @@ int main(int argc, char *argv[])
} else if (argv[0]) {
// Files pass in as command line args:
struct stat statbuf;
- if (!argv[1]) // Don't print filename for single-file matching
+ if (!argv[1] && !(stat(argv[0], &statbuf) == 0 && S_ISDIR(statbuf.st_mode))) // Don't print filename for single-file matching
options.print_filenames = false;
for ( ; argv[0]; argv++) {
if (stat(argv[0], &statbuf) == 0 && S_ISDIR(statbuf.st_mode)) // Symlinks are okay if manually specified