From 3544ae60047f9bb94d5ce8c699c9c2b444a73f35 Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Sat, 14 Oct 2006 14:51:59 +0000 Subject: grep: fix combination of -r and -h --- findutils/grep.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'findutils') diff --git a/findutils/grep.c b/findutils/grep.c index 1285d21f8..12cad34aa 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; } -- cgit v1.2.3