summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* build: detect PCRE support also when <pcre/pcre.h> is the headerJim Meyering2010-03-303-2/+11
| | | | | | | | | * m4/pcre.m4: Also check for <pcre/pcre.h>. * src/pcresearch.c: Include <pcre/pcre.h>, if needed. Guard inclusions with HAVE_PCRE_H and HAVE_PCRE_PCRE_H, not HAVE_LIBPCRE. * NEWS (Bug fixes): Mention it. Dmitry V. Levin reported that PCRE support was not detected on systems with <pcre.h> not in the default include path.
* post-release administriviaJim Meyering2010-03-293-2/+5
| | | | | | * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update.
* version 2.6.2v2.6.2Jim Meyering2010-03-291-1/+1
| | | | * NEWS: Record release date.
* build: avoid warnings on cygwinEric Blake2010-03-292-2/+3
| | | | | | * lib/savedir.c (isdir): Avoid shadowing a declaration. * src/main.c (get_nondigit_option): Cast away const to avoid compiler warning.
* maint: ignore new test executableEric Blake2010-03-291-0/+1
| | | | * .gitignore: Enhance.
* doc: consolidate redundant-looking entriesJim Meyering2010-03-291-3/+1
| | | | | * NEWS: Consolidate the two --include/exclude-related entries. Suggested by Eric Blake.
* tests: use $(...) consistentlyPaolo Bonzini2010-03-2910-29/+29
| | | | | | | | | | | | | * tests/backref.sh: Use `...' instead of ``...'' in comments. * tests/bre.awk: Use $(...) instead of `...`. * tests/ere.awk: Use $(...) instead of `...`. * tests/euc-mb: Use $(...) instead of `...`. * tests/fmbtest: Use $(...) instead of `...`. * tests/foad1: Use $(...) instead of `...`. * tests/pcre-z: Use $(...) instead of `...`. Quote output of grep. * tests/spencer1-locale.awk: Use $(...) instead of `...`. * tests/spencer1.awk: Use $(...) instead of `...`. * tests/yesno.sh: Use $(...) instead of `...`.
* build: make doc/Makefile.am cleaner and more robustJim Meyering2010-03-291-9/+4
| | | | | | | | | * doc/Makefile.am (egrep.1 fgrep.1): Generate robustly, i.e., do not redirect directly to $@. Use $(AM_V_GEN). Do not distribute intermediate files like fgrep.man and egrep.man. Likewise, do not use them to generate their %.1 images. Instead, generate the .1 files directly.
* tests: add program to detect localesPaolo Bonzini2010-03-294-16/+72
| | | | | | | | * tests/Makefile.am (check_PROGRAMS): Add get-mb-cur-max. * tests/get-mb-cur-max.c: New. * tests/euc-mb: Use it. Fail if the former detection test fails. * tests/sjis-mb: Use it. Fail if the former detection test fails. Expand comments.
* tests: add tests for SJIS character setsPaolo Bonzini2010-03-292-0/+51
| | | | | | | | | | | | | | | The attached test will be skipped unless (on a glibc system) you run something like mkdir /usr/lib/locale/ja_JP.SHIFT_JIS zcat /usr/share/i18n/charmaps/SHIFT_JIS.gz | \ localedef \ -f - \ -i /usr/share/i18n/locales/ja_JP \ /usr/lib/locale/ja_JP.SHIFT_JIS * tests/Makefile.am: Add sjis-mb. * tests/sjis-mb: New.
* grep -F: fix a bug with SJIS character setsPaolo Bonzini2010-03-291-5/+11
| | | | | | | | | | | Commit db9d6 would erroneously skip matches in SJIS character sets. In this character set low bytes (i.e. ASCII bytes) are also valid second bytes in a double-byte character, so you have to continue looking for a match, even if you match in the middle of a double-byte character. * src/kwsearch.c: Ensure that beg is advanced by at least one byte, but do not fail immediately after matching in the middle of a double-byte character.
* build: update after change in gnulib's lib-ignore moduleBruno Haible2010-03-291-0/+3
| | | | | * src/Makefile.am (AM_LDFLAGS): Define. Use gnulib's new $(IGNORE_UNUSED_LIBRARIES_CFLAGS).
* tests: disable new texinfo-acronym syntax-check from gnulibJim Meyering2010-03-291-0/+1
| | | | * cfg.mk (local-checks-to-skip): Add new sc_texinfo_acronym, to skip it.
* tests: exercise fix for improper match of incomplete MB char prefixNorihiro Tanaka2010-03-282-0/+20
| | | | | * tests/prefix-of-multibyte: New file. * tests/Makefile.am (TESTS): Add it.
* grep -F: fix a multi-byte erroneous-match-in-middle bugJim Meyering2010-03-285-6/+14
| | | | | | | | | | | | | | | | | | | | | Just as Perl prints nothing in this case, printf '\357\274\241\n' | perl -CIO -lne '/\357/ and print' grep should also print nothing when used as follows. However, these would mistakenly match with grep prior to 2.6.2: printf '\357\274\241\n' | LC_ALL=en_US.UTF-8 src/grep -F $'\357' printf '\357\274\241\n' | LC_ALL=en_US.UTF-8 src/grep -F $'\357\274' * src/searchutils.c (is_mb_middle): New parameter: the length of the match, in bytes, as determined by kwsexec. Use this to detect when the nominal match found by kwsexec must be skipped because it is for an incomplete multi-byte character that is a prefix of a character in the input. * src/dfasearch.c (EGexecute): Update caller. * src/kwsearch.c (Fexecute): Likewise. * src/search.h: Update prototype. * NEWS (Bug fixes): Mention it. Report and analysis by Norihiro Tanaka.
* tests: add tests for the fgrep-infloop bugNorihiro Tanaka2010-03-284-2/+29
| | | | | | * tests/init.cfg (require_timeout_): New function. * tests/fgrep-infloop: New file. Test for the above fix. * tests/Makefile.am (TESTS): Add it.
* grep -F: avoid infinite loop when searching for incomplete MB characterJim Meyering2010-03-282-0/+6
| | | | | | | | | | | | | | | | | | | | | | | Searching for an incomplete non-prefix of a multi-byte character should find no match. Just as these print nothing, printf '\357\274\241\357\274\241\n' \ | perl -CIO -ne '/\241\357/ and print' printf '\357\274\241\n' | perl -CIO -ne '/\274\241/ and print' printf '\357\274\241\n' | perl -CIO -ne '/\241/ and print' printf '\357\274\241\n' | perl -CIO -ne '/\274/ and print' These should also print nothing, but with grep-2.6 and grep-2.6.1, they would infloop: printf '\357\274\241\n' | LC_ALL=en_US.UTF-8 src/grep -F $'\241' printf '\357\274\241\n' | LC_ALL=en_US.UTF-8 src/grep -F $'\274' printf '\357\274\241\n' | LC_ALL=en_US.UTF-8 src/grep -F $'\274\241' * src/kwsearch.c (Fexecute): Don't infloop when searching for an incomplete non-prefix part of a multi-byte character. * NEWS (Bug fixes): Mention it. Reported and diagnosed by Norihiro Tanaka.
* tests: rename: fmbtest.sh -> fmbtestJim Meyering2010-03-282-1/+1
| | | | | | * tests/fmbtest.sh: Rename to ... * tests/fmbtest: ...this, dropping the .sh suffix. * tests/Makefile.am (TESTS): Reflect renaming.
* tests: convert fmbtest.sh to use init.shJim Meyering2010-03-281-15/+16
| | | | | * tests/fmbtest.sh: Use init.sh and adapt accordingly: Use "grep", not ${GREP}. Use Exit, not exit.
* tests: also exercise the --include + glob pathJim Meyering2010-03-281-0/+6
| | | | * tests/include-exclude: Exercise Javier's fix.
* grep -r: fix --include with globs, tooJavier Villavicencio2010-03-282-1/+2
| | | | | | | The previous fix addressed only the non-glob case. * src/main.c (main): Use add_exclude's EXCLUDE_WILDCARDS option, to enable the use of fnmatch with --include=GLOB. gnulib: Update to latest, for the fixed exclude.c.
* grep -r: fix --include with non-globsJim Meyering2010-03-284-1/+9
| | | | | | | | * lib/savedir.c (savedir): Fix logic error. Introduced by commit bf3bd92c, "build: adapt to the newer exclude API we now get from gnulib" * tests/include-exclude: Test for this bug by exercising --include, too. * NEWS (Bug fixes): Mention it. Reported by Philipp Kohlbecher in http://savannah.gnu.org/bugs/?29358
* kwset: correct comments; require non-NULL kwsmatch argumentJim Meyering2010-03-272-19/+16
| | | | | | | | | * src/kwset.c (kwsexec): Correct comments. This function has been returning an offset, not a pointer, for 9 years. Do not test for kwsmatch == NULL. All callers pass non-NULL. (cwexec): Likewise. * src/kwset.h (kwsexec): Mark the 4th parameter, kwsmatch, as non-NULL. Include "arg-nonnull.h".
* build: add -I$(top_builddir)/lib so we also find generated .h filesJim Meyering2010-03-271-1/+1
| | | | | | | * src/Makefile.am (AM_CPPFLAGS): Rename from INCLUDES to avoid warning from automake -Wall. Add -I$(top_builddir)/lib, so we find generated .h files like getopt.h in a non-srcdir build.
* build: remove superfluous LOCALEDIR definitionJim Meyering2010-03-272-1/+2
| | | | | | * src/Makefile.am (INCLUDES): Remove unnecessary definition of LOCALEDIR here. Now, it's defined via gnulib's configmake.h. * src/system.h: Include "configmake.h" for its LOCALEDIR definition.
* grep: don't segfault upon use of --include or --exclude* optionsJim Meyering2010-03-275-1/+40
| | | | | | | | * lib/savedir.c (isdir1): Fix fatal typo: deref "dir" argument, not the global (initially-NULL) "path". Reported by Standish Parsley. * tests/include-exclude: New file. * tests/Makefile.am (TESTS): Add it. * NEWS (Bug fixes): Mention it.
* tests: rename: foad1.sh -> foad1Jim Meyering2010-03-262-1/+1
| | | | | | * tests/foad1.sh: Rename to ... * tests/foad1: ...this, dropping the .sh suffix. * tests/Makefile.am (TESTS): Reflect renaming.
* tests: convert foad1.sh to use init.shJim Meyering2010-03-262-8/+9
| | | | | | | | | | This fixes a spurious test failure when "make check" is run with certain envvars set, e.g., "make check GREP_COLOR=always" * tests/foad1.sh: Use init.sh and adapt accordingly: Use "grep", not ${GREP}. Test VERBOSE against "yes", not "1", to be consistent with init.sh. Use Exit, not exit. Reported by Nelson H. F. Beebe.
* tests: insulate tests from envvar settingsJim Meyering2010-03-261-0/+29
| | | | | | * tests/init.cfg (vars_): Unset each envvar that can affect how grep works. This protects only those tests that have been converted to use init.sh.
* maint: ignore 'make dist pdf' droppingsEric Blake2010-03-261-0/+14
| | | | * .gitignore: Add more exemptions.
* tests: avoid spurious test failure due to lack of a French UTF8 localeJim Meyering2010-03-263-0/+8
| | | | | | | * tests/init.cfg: New file. If either $LOCALE_FR or $LOCALE_FR_UTF8 is set to "none", reset it to the empty string. Reported by Mike Frysinger and Sven Joachim. * tests/Makefile.am (EXTRA_DIST): Add init.cfg.
* build: do not use pkg-config to test for PCRE supportJim Meyering2010-03-265-20/+52
| | | | | | | | | | | | | | * configure.ac: Do not use PKG_PROG_PKG_CONFIG or PKG_CHECK_MODULES. Do not modify CPPFLAGS; that belongs to those who invoke make. Instead, use autoconf's AC_CHECK_HEADERS and AC_SEARCH_LIBS via the new macro, gl_FUNC_PCRE, defined in... * m4/pcre.m4 (gl_FUNC_PCRE): New macro, to handle pcre-related configure-time tests. * src/Makefile.am (grep_LDADD): Use LIB_PCRE, not PCRE_LIBS. * src/pcresearch.c: Test HAVE_LIBPCRE via "#if", not "#ifdef". All other cpp tests of this symbol used "#if". Prompted by a suggestion from Bruno Haible. * NEWS (Build-related): Mention this.
* doc: correct and amend NEWS entries for 2.6.1Jim Meyering2010-03-252-3/+6
| | | | | | | * NEWS (Bug fixes): Correct character ranges bug description. Add an example from Dmitry V. Levin. Add that the word-with-backref bug was introduced in 2.5.1. * cfg.mk (old_NEWS_hash): Update to match.
* post-release administriviaJim Meyering2010-03-253-2/+5
| | | | | | * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update.
* version 2.6.1v2.6.1Jim Meyering2010-03-251-1/+1
| | | | * NEWS: Record release date.
* tests: use awk's -v option more portablyTony Abou-Assaleh2010-03-251-1/+1
| | | | | * tests/spencer1-locale: Add a space between awk's "-v" option and the following VAR=value string, to avoid test failure on Mac OS X.
* dfa/grep: fix compilation with MBS_SUPPORTNorihirio Tanaka2010-03-255-7/+37
| | | | | | | | | | | | * src/dfa.c (cur_mb_len): Initialize to 1 and always make it available. (setbit_case_fold): Do not use wint_t in prototype if !MBS_SUPPORT. (parse_bracket_exp): Fix compilation with !MBS_SUPPORT. * src/kwsearch.c (kwsinit): Do not use mbtolower and MB_CUR_MAX if !MBS_SUPPORT. * src/searchutils.c (kwsinit): Do not refer to MB_CUR_MAX if !MBS_SUPPORT. * tests/char-class-multibyte: Skip if UTF-8 matching does not work. * tests/fmbtest.sh: Likewise.
* build: avoid warnings about unnecessary use of "return"Jim Meyering2010-03-252-7/+7
| | | | | | | | * src/grep.c (Gcompile, Ecompile, Acompile): Do not "return X" from a function returning void, not even when X itself is a function returning void. This avoids warnings from Sun Studio 11 reported by Dagobert Michelsen. * src/egrep.c (Ecompile): Likewise.
* grep: fix printing when -w is used and regex is needed for matchingNorihirio Tanaka2010-03-254-2/+21
| | | | | | | | * NEWS: Document bugfix. * src/dfasearch.c (EGexecute): After assess_pattern_match len, is either invalid or end-beg; jump to success. * tests/Makefile.am (TESTS): Add new test. * tests/backref-word: New.
* dfa: fix single byte character rangesPaolo Bonzini2010-03-254-1/+7
| | | | | | | | * src/dfa.c (in_coll_range): Fix ordering for second strcoll. Reported by Dmitry V. Levin. * tests/spencer1-locale.awk: Also test single-byte character sets. * NEWS: Add a note about this bugfix. * THANKS: Add Dmitry.
* grep: reset state after truncated or invalid multibyte sequencesNorihirio Tanaka2010-03-251-0/+1
| | | | | | * src/searchutils.c (is_mb_middle): When treating an invalid sequence or a truncated multibyte character as a single byte character, reset mbstate
* grep: do lowercase conversion in print_line_middle only for single-byte caseNorihirio Tanaka2010-03-251-5/+9
| | | | | * src/main.c (print_line_middle): Restrict match_icase code to MB_CUR_MAX == 1. Adjust comments.
* tests: provide framework_failure_ functionJim Meyering2010-03-259-17/+18
| | | | | | | | | | | | | | | | The shell function "framework_failure" was called in the unusual event that some fundamental test set-up operation would fail. However it was not defined. Define it, but with a trailing underscore to impinge less on the test writer's name space. Adjust all uses. * tests/init.sh (framework_failure_): New function. * tests/case-fold-backref: s/framework_failure/framework_failure_/ * tests/case-fold-char-class: Likewise. * tests/case-fold-char-range: Likewise. * tests/case-fold-char-type: Likewise. * tests/char-class-multibyte: Likewise. * tests/dfaexec-multibyte: Likewise. * tests/max-count-vs-context: Likewise. * tests/word-multi-file: Likewise.
* doc: tweak THANKSJim Meyering2010-03-251-1/+1
| | | | * THANKS: Update Arnold's name and address, per request.
* portability: use gnulib's lseek wrapperJim Meyering2010-03-241-0/+1
| | | | | | * bootstrap.conf (gnulib_modules): Use gnulib's lseek wrapper, for improved portability. lseek does not fail with ESPIPE on pipes on some systems.
* build: avoid link failure on Solaris 8Jim Meyering2010-03-243-0/+6
| | | | | | * bootstrap.conf (gnulib_modules): Add wctob. * NEWS (Portability): Mention this. Reported by Dagobert Michelsen in <http://sv.gnu.org/bugs/?29325>.
* doc: translate new --help messagePetr Písař2010-03-241-1/+1
| | | | * src/main.c: Translate "after_options".
* doc: NEWS make it clear that the bug was introduced in 2.6Jim Meyering2010-03-241-1/+2
| | | | * NEWS: Clarify.
* tests: fix char-class-multibytePaolo Bonzini2010-03-241-4/+4
| | | | * tests/char-class-multibyte: Make it pass.
* build: avoid compilation failure when MBS_SUPPORT not definedJim Meyering2010-03-231-1/+1
| | | | * src/dfa.c (setbit_case_fold) [!MBS_SUPPORT]: Fix curly brace mismatch.