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
parent
2f67e21393
commit
47e3c088c9
|
@ -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'])
|
||||
|
|
Loading…
Reference in New Issue