Re: [hackers] [sbase] grep: make E and F flags mutually exclusive

From: Quentin Rameau <quinq_AT_fifth.space>
Date: Tue, 5 Jan 2016 14:52:46 +0100

Don't make F the priority flag when both E and F are given, instead use
the last one.
---
 grep.c | 3 +++
 1 file changed, 3 insertions(+)
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;
-- 
2.6.4
Received on Tue Jan 05 2016 - 14:52:46 CET

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