From 214be13d33a26ab45231afe8e983d9a174aae282 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 20 Dec 2016 08:56:06 -0800 Subject: grep: simplify matcher configuration * src/grep.c (matcher, compile): Remove static vars. (compile_fp_t): Now takes a 3rd syntax argument. (Gcomppile, Ecompile, Acompile, GAcompile, PAcompile): Remove. (struct matcher): Now nameless, since it is used only once. Make 'name' a bit shorter. New member 'syntax'. (matchers): Initialize it, and change removed functions to GEAcompile. (F_MATCHER_INDEX, G_MATCHER_INDEX): New constants. (setmatcher): New arg MATCHER, and return new matcher index. Avoid unnecessary call to strcmp. (main): Keep matcher as a local int, not a global pointer. * src/kwsearch.c (Fcompile): * src/pcresearch.c (Pcompile): Ignore the 3rd syntax argument. --- src/pcresearch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/pcresearch.c') diff --git a/src/pcresearch.c b/src/pcresearch.c index 108baff8..0e34861d 100644 --- a/src/pcresearch.c +++ b/src/pcresearch.c @@ -88,7 +88,7 @@ static int empty_match[2]; #endif void -Pcompile (char const *pattern, size_t size) +Pcompile (char const *pattern, size_t size, reg_syntax_t ignored) { #if !HAVE_LIBPCRE die (EXIT_TROUBLE, 0, -- cgit v1.2.1