diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2016-09-01 08:43:48 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2016-09-01 08:53:16 -0700 |
commit | 1e166fdaa69902793057ed2a63408f51c3b4273b (patch) | |
tree | ce8c9baaac32220793f1a1cf86400e2d6259dcca /src/kwsearch.c | |
parent | 960ad317db21e781b04010f4128bb149273a3327 (diff) | |
download | grep-1e166fdaa69902793057ed2a63408f51c3b4273b.tar.gz |
grep: avoid code duplication with -iF
This follows up on the -iF performance improvement (Bug#23752).
* NEWS: Simplify description of -iF improvement.
* src/dfa.c: Do not include wctype.h.
(lonesome_lower, case_folded_counterparts): Move to localeinfo.c.
(CASE_FOLDED_BUFSIZE): Move to localeinfo.h.
* src/grep.c: Do not include wctype.h.
(lonesome_lower): Remove.
(fgrep_icase_available): Use case_folded_counterparts instead.
Do not call it for the same character twice.
Return false on wcrtomb failures (which should never happen).
(fgrep_to_grep_pattern, main): Simplify. Let fgrep_to_grep’s
caller fiddle with the global variables.
* src/localeinfo.c: Include <wctype.h>
(lonesome_lower, case_folded_counterparts):
Move here from src/dfa.c. Return int, not unsigned int.
Verify that CASE_FOLDED_BUFSIZE is big enough.
* src/localeinfo.h (CASE_FOLDED_BUFSIZE): Now 32, so that
we don’t expose lonesome_lower’s size.
* src/searchutils.c (kwsinit): Return new kwset instead of
storing it via a pointer. All callers changed. Simplify a bit.
Diffstat (limited to 'src/kwsearch.c')
-rw-r--r-- | src/kwsearch.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/kwsearch.c b/src/kwsearch.c index 7fe08aa4..29d140cd 100644 --- a/src/kwsearch.c +++ b/src/kwsearch.c @@ -38,7 +38,7 @@ Fcompile (char const *pattern, size_t size) { size_t total = size; - kwsinit (&kwset, true); + kwset = kwsinit (true); char const *p = pattern; do |