Project

General

Profile

Bug #12785

grep -h ignored with -r

Added by Peter Tribble 4 days ago. Updated 4 days ago.

Status:
New
Priority:
Normal
Assignee:
Category:
cmd - userland programs
Start date:
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

Following the update of grep in #8858, grep -hr no longer works as expected.

A recursive grep (grep -r) will show matched filenames by default, but it's expected that -h will disable this. That's true of the old /usr/bin/grep and of GNU grep, but not of the old xpg4 grep and hence our current grep, which displays matching filenames if both -h and -r are given

Looking at the code, recursion sets outfn to 1. In the old grep, this was considered along with hflag at the output stage, allowing -h to override. This is no longer the case.

History

#1

Updated by Peter Tribble 4 days ago

Also available in: Atom PDF