grep: make E and F flags mutually exclusive

Don't make F the priority flag when both E and F are given, instead use
the last one.
This commit is contained in:
Quentin Rameau 2016-01-05 14:52:46 +01:00 committed by sin
parent 16159a61ac
commit eeeb7a6e53
1 changed files with 3 additions and 0 deletions

3
grep.c
View File

@ -183,10 +183,13 @@ main(int argc, char *argv[])
ARGBEGIN {
case 'E':
Eflag = 1;
Fflag = 0;
flags |= REG_EXTENDED;
break;
case 'F':
Fflag = 1;
Eflag = 0;
flags &= ~REG_EXTENDED;
break;
case 'H':
Hflag = 1;