diff options
author | kevans <kevans@FreeBSD.org> | 2017-08-16 22:00:56 +0000 |
---|---|---|
committer | kevans <kevans@FreeBSD.org> | 2017-08-16 22:00:56 +0000 |
commit | 9f5428ad15d946bee4ac750f3916ff9322accaf9 (patch) | |
tree | b54f46693c94406e7b79ccd3c9e5ebfcf1d1e0d5 /usr.bin | |
parent | f9ac1ee50cbb2e0b00a3254c9aaf012183e8aaa8 (diff) | |
download | FreeBSD-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.c | 9 |
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; |