summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko2006-10-14 14:51:59 +0000
committerDenis Vlasenko2006-10-14 14:51:59 +0000
commit3544ae60047f9bb94d5ce8c699c9c2b444a73f35 (patch)
treec9c1546fece532364f581f9a9baec7627d9ad604
parent3a6755f56f811f246934f02182531fb1e8ccc72d (diff)
downloadbusybox-3544ae60047f9bb94d5ce8c699c9c2b444a73f35.zip
busybox-3544ae60047f9bb94d5ce8c699c9c2b444a73f35.tar.gz
grep: fix combination of -r and -h
-rw-r--r--findutils/grep.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/findutils/grep.c b/findutils/grep.c
index 1285d21..12cad34 100644
--- a/findutils/grep.c
+++ b/findutils/grep.c
@@ -430,7 +430,8 @@ int grep_main(int argc, char **argv)
if (option_mask32 & GREP_OPT_r) {
struct stat st;
if (stat(cur_file, &st) == 0 && S_ISDIR(st.st_mode)) {
- print_filename = 1;
+ if (!(option_mask32 & GREP_OPT_h))
+ print_filename = 1;
matched += grep_dir(cur_file);
goto grep_done;
}