bsdgrep: avoid use of magic number for REG_NOSPEC

Submitted by:	Kyle Evans <kevans91 at ksu.edu>
Differential Revision:	https://reviews.freebsd.org/D10420
This commit is contained in:
Ed Maste 2017-05-02 21:08:38 +00:00
parent 41e04e8c77
commit 476d209821
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=317705

View File

@ -716,8 +716,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;