[hackers] [sbase] grep: make E and F flags mutually exclusive || Quentin Rameau

From: <git_AT_suckless.org>
Date: Tue, 5 Jan 2016 14:54:22 +0100 (CET)

commit eeeb7a6e53ae54b795f47131bf36227d6fd3fe87
Author: Quentin Rameau <quinq_AT_fifth.space>
AuthorDate: Tue Jan 5 14:52:46 2016 +0100
Commit: sin <sin_AT_2f30.org>
CommitDate: Tue Jan 5 13:54:17 2016 +0000

    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.

diff --git a/grep.c b/grep.c
index ca255ff..9f4093c 100644
--- a/grep.c
+++ b/grep.c
_AT_@ -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;
Received on Tue Jan 05 2016 - 14:54:22 CET

This archive was generated by hypermail 2.3.0 : Tue Jan 05 2016 - 15:00:20 CET