From 42c75cfd7372042c5e7de2d8cd83ac064035c449 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 19 Sep 2021 17:08:51 -0700 Subject: Fix for single-arg when it's a directory --- bp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bp.c') 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 -- cgit v1.2.3