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

3
grep.c
View File

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