summaryrefslogtreecommitdiffstats
path: root/usr.bin/grep/grep.c
diff options
context:
space:
mode:
authorgrehan <grehan@FreeBSD.org>2011-06-28 06:26:03 +0000
committergrehan <grehan@FreeBSD.org>2011-06-28 06:26:03 +0000
commit2c6741be0f59191f2283eb268e4f7690399d578a (patch)
treeb139c8c6dcca4fa284815daade405b75886ee360 /usr.bin/grep/grep.c
parent3c35264f695e0a1f8a04dbcca1c93bb5159b2274 (diff)
parent19ae02bba572390c7299166228d31e54003e094a (diff)
downloadFreeBSD-src-2c6741be0f59191f2283eb268e4f7690399d578a.zip
FreeBSD-src-2c6741be0f59191f2283eb268e4f7690399d578a.tar.gz
IFC @ r222830
Diffstat (limited to 'usr.bin/grep/grep.c')
-rw-r--r--usr.bin/grep/grep.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.bin/grep/grep.c b/usr.bin/grep/grep.c
index 0047650..d03c13c 100644
--- a/usr.bin/grep/grep.c
+++ b/usr.bin/grep/grep.c
@@ -73,7 +73,7 @@ const char *errstr[] = {
};
/* Flags passed to regcomp() and regexec() */
-int cflags = 0;
+int cflags = REG_NOSUB;
int eflags = REG_STARTEND;
/* Shortcut for matching all cases like empty regex */
@@ -519,6 +519,7 @@ main(int argc, char *argv[])
break;
case 'o':
oflag = true;
+ cflags &= ~REG_NOSUB;
break;
case 'p':
linkbehave = LINK_SKIP;
@@ -552,9 +553,11 @@ main(int argc, char *argv[])
break;
case 'w':
wflag = true;
+ cflags &= ~REG_NOSUB;
break;
case 'x':
xflag = true;
+ cflags &= ~REG_NOSUB;
break;
case 'Z':
filebehave = FILE_GZIP;
@@ -588,6 +591,7 @@ main(int argc, char *argv[])
strcasecmp("none", optarg) != 0 &&
strcasecmp("no", optarg) != 0)
errx(2, getstr(3), "--color");
+ cflags &= ~REG_NOSUB;
break;
case LABEL_OPT:
label = optarg;
OpenPOWER on IntegriCloud