Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 May 2017 21:08:38 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r317705 - head/usr.bin/grep
Message-ID:  <201705022108.v42L8c9M066476@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201705022108.v42L8c9M066476>