svn commit: r317705 - head/usr.bin/grep
Ed Maste
emaste at FreeBSD.org
Tue May 2 21:08:40 UTC 2017
Author: emaste
Date: Tue May 2 21:08:38 2017
New Revision: 317705
URL: https://svnweb.freebsd.org/changeset/base/317705
Log:
bsdgrep: avoid use of magic number for REG_NOSPEC
Submitted by: Kyle Evans <kevans91 at ksu.edu>
Differential Revision: https://reviews.freebsd.org/D10420
Modified:
head/usr.bin/grep/grep.c
Modified: head/usr.bin/grep/grep.c
==============================================================================
--- head/usr.bin/grep/grep.c Tue May 2 20:44:06 2017 (r317704)
+++ head/usr.bin/grep/grep.c Tue May 2 21:08:38 2017 (r317705)
@@ -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;
More information about the svn-src-head
mailing list