summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorkevans <kevans@FreeBSD.org>2017-08-16 22:00:56 +0000
committerkevans <kevans@FreeBSD.org>2017-08-16 22:00:56 +0000
commit9f5428ad15d946bee4ac750f3916ff9322accaf9 (patch)
treeb54f46693c94406e7b79ccd3c9e5ebfcf1d1e0d5 /usr.bin
parentf9ac1ee50cbb2e0b00a3254c9aaf012183e8aaa8 (diff)
downloadFreeBSD-src-9f5428ad15d946bee4ac750f3916ff9322accaf9.zip
FreeBSD-src-9f5428ad15d946bee4ac750f3916ff9322accaf9.tar.gz
MFC r317705: bsdgrep: avoid use of magic number for REG_NOSPEC
Approved by: emaste (mentor, blanket MFC)
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/grep/grep.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.bin/grep/grep.c b/usr.bin/grep/grep.c
index 7bebe02..9844bd1 100644
--- a/usr.bin/grep/grep.c
+++ b/usr.bin/grep/grep.c
@@ -717,8 +717,13 @@ main(int argc, char *argv[])
case GREP_BASIC:
break;
case GREP_FIXED:
- /* XXX: header mess, REG_LITERAL not defined in gnu/regex.h */
- cflags |= 0020;
+#if defined(REG_NOSPEC)
+ cflags |= REG_NOSPEC;
+#elif defined(REG_LITERAL)
+ cflags |= REG_LITERAL;
+#else
+ errx(2, "literal expressions not supported at compile time");
+#endif
break;
case GREP_EXTENDED:
cflags |= REG_EXTENDED;
OpenPOWER on IntegriCloud