From 9f5428ad15d946bee4ac750f3916ff9322accaf9 Mon Sep 17 00:00:00 2001 From: kevans Date: Wed, 16 Aug 2017 22:00:56 +0000 Subject: MFC r317705: bsdgrep: avoid use of magic number for REG_NOSPEC Approved by: emaste (mentor, blanket MFC) --- usr.bin/grep/grep.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'usr.bin') 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; -- cgit v1.1