diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2014-09-14 14:52:56 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2014-09-16 18:23:49 -0700 |
commit | 6e319a818ed7b15b452ed2baab2f6a38d42fd1fe (patch) | |
tree | 42a80dcac7ef57d4ca41df6f4ddb03c38d4fce16 /configure.ac | |
parent | cd36abd46c5e0768606979ea75a51732062f5624 (diff) | |
download | grep-6e319a818ed7b15b452ed2baab2f6a38d42fd1fe.tar.gz |
grep: improve performance for older glibc
glibc has a bug where mbrlen and mbrtowc mishandle length-0 inputs.
Working around it in gnulib slows grep down, so disable the tests for it
and make sure grep works even if the bug is present.
* bootstrap.conf (avoided_gnulib_modules): Add mbrtowc-tests.
* configure.ac (gl_cv_func_mbrtowc_empty_input): Assume yes.
* src/searchutils.c (mb_next_wc): Don't invoke mbrtowc on empty input.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 3315855d..4d069b87 100644 --- a/configure.ac +++ b/configure.ac @@ -83,6 +83,11 @@ AC_PROG_CC gl_EARLY AC_PROG_RANLIB +# grep never invokes mbrtowc or mbrlen on empty input, +# so don't worry about this common bug, +# as working around it would merely slow grep down. +gl_cv_func_mbrtowc_empty_input='assume yes' + dnl Checks for typedefs, structures, and compiler characteristics. AC_TYPE_SIZE_T AC_C_CONST |