grep: fix handling of -b flag

Output buffering is automatically disabled when reading from stdin.
In this case, supplying the -b flag ought to be redundant.  However,
since Bflag was being XORed into the flag set - rather than simply
ORed - supplying -b would actually enable output buffering.
front
Alex Musolino 2020-03-26 18:24:39 +10:30
parent 2f67e21393
commit 47e3c088c9
1 changed files with 1 additions and 1 deletions

View File

@ -91,7 +91,7 @@ search(char *file, int flag)
}
if(flags['b'])
flag ^= Bflag; /* dont buffer output */
flag |= Bflag; /* dont buffer output */
if(flags['c'])
flag |= Cflag; /* count */
if(flags['h'])