summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* version 3.6v3.6Jim Meyering2020-11-081-1/+1
| | | | * NEWS: Record release date.
* build: update gnulib to latest for test improvementsJim Meyering2020-11-051-0/+0
|
* build: update gnulib to latest for C++-ready dfa.h and test-verify.c fixJim Meyering2020-11-031-0/+0
|
* grep: remove GREP_OPTIONSPaul Eggert2020-11-036-98/+22
| | | | | | | | | | | | * NEWS: Mention this. * doc/grep.in.1: Remove GREP_OPTIONS documentation. * doc/grep.texi (Environment Variables): Move GREP_OPTIONS stuff into a “no longer implemented” paragraph. * src/grep.c (prepend_args, prepend_default_options): Remove. (main): Do not look at GREP_OPTIONS. * tests/Makefile.am (TESTS_ENVIRONMENTS): * tests/init.cfg (vars_): Remove GREP_OPTIONS.
* grep: use RE_NO_SUB when calling regex solely to check syntaxNorihiro Tanaka2020-11-011-4/+12
| | | | | | | * src/dfasearch.c (regex_compile): New parameter. All callers changed. (GEAcompile): Move setting syntax for regex into regex_compile() function. This addresses a performance problem exposed by extreme regular expressions, as described in https://bugs.gnu.org/43862 .
* tests: add the test for bugfix in gnulib's dfaNorihiro Tanaka2020-11-011-0/+2
| | | | * tests/ere.tests: Add new test.
* grep: avoid erroneous matches for e.g., a+a+a+Jim Meyering2020-11-012-0/+5
| | | | | * gnulib: Update to latest, for dfa's invalid-merge fix. * NEWS (Bug fixes): Mention this.
* grep: -P: report input filename upon PCRE execution failureJim Meyering2020-10-115-8/+32
| | | | | | | | | | | | Without this, it could be tedious to determine which input file evokes a PCRE-execution-time failure. * src/pcresearch.c (Pexecute): When failing, include the error-provoking file name in the diagnostic. * src/grep.c (input_filename): Make extern, since used above. * src/search.h (input_filename): Declare. * tests/filename-lineno.pl: Test for this. ($no_pcre): Factor out. * NEWS (Bug fixes): Mention this.
* grep: minor kwset cleanupsPaul Eggert2020-10-113-36/+20
| | | | | | | | | * src/kwsearch.c (Fexecute): Assume C99 to put declarations nearer uses. * src/kwset.c (bmexec): Omit unnecessary test. * src/kwset.h (struct kwsmatch): Make OFFSET and SIZE individual elements, not arrays of size 1 (a revenant of an earlier API). All uses changed.
* grep: remove unused codeNorihiro Tanaka2020-10-111-47/+0
| | | | | * src/kwsearch.c (Fcompile, Fexecute): Remove unused code. No longer these are used after commit 016e590a8198009bce0e1078f6d4c7e037e2df3c.
* build: update gnulib submodule to latestPaul Eggert2020-10-051-0/+0
|
* tests: correct filename-lineno.plJim Meyering2020-10-051-1/+1
| | | | | * tests/filename-lineno.pl: Remove a stray envvar that somehow slipped into expected output string.
* tests: fix tests when PCRE is not usedPaul Eggert2020-10-052-9/+10
| | | | | | | | | * tests/Makefile.am (TESTS_ENVIRONMENT): Set PATH before setting PCRE_WORKS, so that the latter test uses the just-built grep. * tests/filename-lineno.pl (invalid-re-P-paren) (invalid-re-P-star-paren): Adjust non-PCRE case to match recently-changed behavior.
* build: update gnulib submodule to latestPaul Eggert2020-10-051-0/+0
|
* doc: document --include/--exclude betterPaul Eggert2020-10-032-0/+15
| | | | | | | | Problem reported by John Ruckstuhl (Bug#43782). * doc/grep.texi (File and Directory Selection): Document what happens if contradictory options are given, or if no option matches a file name. * doc/grep.in.1:
* maint: add technically-required quotesJim Meyering2020-10-011-3/+3
| | | | | * configure.ac: Quote args of AC_CONFIG_AUX_DIR, AC_CONFIG_SRCDIR and AC_CHECK_FUNCS_ONCE.
* tests: restore deleted -P testsJim Meyering2020-09-282-0/+18
| | | | | | | | | | | v3.4-almost-45-g8577dda deleted these two -P-using tests because a grep built without PCRE support would fail those tests. This sets an envvar with the equivalent of the result from the require_pcre_ function and restores the now-guarded tests. Tested by running this: ./configure --disable-perl-regexp && make check * tests/Makefile.am (PCRE_WORKS): Set this envvar. * tests/filename-lineno.pl: Restore invalid-re-P-paren and invalid-re-P-star-paren, now each with a guard.
* maint: post-release administriviaJim Meyering2020-09-273-2/+5
| | | | | | * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update.
* version 3.5v3.5Jim Meyering2020-09-271-1/+1
| | | | * NEWS: Record release date.
* maint: avoid autoconf warningsJim Meyering2020-09-272-2/+1
| | | | | * configure.ac (AC_HEADER_STDC): Remove. It's been assumed for ages. * m4/pcre.m4 (gl_FUNC_PCRE): Use AS_HELP_STRING, not AC_HELP_STRING.
* build: update gnulib to latestJim Meyering2020-09-271-0/+0
|
* build: update gnulib to latestJim Meyering2020-09-261-0/+0
|
* tests: skip stack-overflow test when built with ASANJim Meyering2020-09-261-0/+9
| | | | | * tests/stack-overflow: Skip this test when the binary was built with ASAN, to avoid spurious failures.
* build: update gnulib submodule to latestPaul Eggert2020-09-251-0/+0
|
* build: update gnulib submodule to latestPaul Eggert2020-09-251-0/+0
|
* tests: fix surrogate-pair test to work on 16-bit wchar_t systemsJim Meyering2020-09-241-5/+19
| | | | | | | | * tests/surrogate-pair: Avoid new failure on systems with 16-bit wchar_t. Detect the condition and exit before the otherwise-failing tests. Remove the now-incorrect in-loop test for that alternate failure mode. This was exposed by testing on gcc119.fsffrance.org, a power8 AIX 7.2 system.
* grep: don't assume PCRE in testsPaul Eggert2020-09-231-6/+0
| | | | | | | * tests/filename-lineno.pl: Remove invalid-re-P-paren and invalid-re-P-star-paren as they assume PCRE support, which causes a false alarm "grep: Perl matching not supported in a --disable-perl-regexp build" on platforms without PCRE.
* grep: pacify Sun C 5.15Paul Eggert2020-09-231-1/+1
| | | | | | | This suppresses a false alarm '"grep.c", line 720: warning: initializer will be sign-extended: -1'. * src/grep.c (uword_max): New static constant. (initialize_unibyte_mask): Use it.
* grep: fix more Turkish-eyes bugsPaul Eggert2020-09-234-57/+102
| | | | | | | | | | | | | | | | | Fix more bugs recently uncovered by Norihiro Tanaka (Bug#43577). * NEWS: Mention new bug report. * src/grep.c (ok_fold): New static var. (setup_ok_fold): New function. (fgrep_icase_charlen): Reject single-byte characters if they match some multibyte characters when ignoring case. This part of the patch is partly derived from <https://bugs.gnu.org/43577#14>, which means it is: Co-authored-by: Norihiro Tanaka <noritnk@kcn.ne.jp> (main): Call setup_ok_fold if ok_fold might be needed. * src/searchutils.c (kwsinit): With the grep.c changes, this code can now revert to classic 7th Edition Unix style; aborting would be wrong. * tests/turkish-eyes: Add tests for these bugs.
* build: update gnulib submodule to latestPaul Eggert2020-09-232-0/+6
| | | | * NEWS: Mention Bug#43577, which this fixes.
* grep: fix recently-introduced performance glitchPaul Eggert2020-09-231-1/+0
| | | | | | * src/grep.c (main): Do not double-increment update_patterns. update_patterns increments n_patterns now; do not increment it again, as the incorrect count would hurt performance heuristics later.
* doc: improve --line-buffer docPaul Eggert2020-09-221-2/+5
| | | | | | * doc/grep.texi (Other Options): Document --line-buffered more carefully, and say what happens when it is not used. Problem reported by Dan Jacobson (Bug#35339).
* tests: port timeout test to AlpinePaul Eggert2020-09-221-0/+2
| | | | | | | | Problem reported by Bruno Haible in: https://lists.gnu.org/r/grep-devel/2020-09/msg00080.html * tests/init.cfg (require_timeout_): Check that ‘timeout 0.01 sleep 0.02’ works as expected, to avoid spurious test failure on Alpine.
* tests: test for many-regexp N^2 RSS regressionJim Meyering2020-09-223-0/+88
| | | | | | | * tests/many-regex-performance: New test for this performance regression. * tests/Makefile.am: Add it. * NEWS (Bug fixes): Describe it.
* grep: avoid unnecessary regex compilationNorihiro Tanaka2020-09-225-23/+28
| | | | | | | | | | | | | | | | | | | Grep resorts to using the regex engine when the precision of either -o or --color is required, or when the pattern is not supported by our DFA engine (e.g., backref). Otherwise, grep would perform regex compilation solely to check the syntax. This change makes grep skip that compilation in the common case for which it is unnecessary. The compilation we are avoiding is quite costly, consuming O(N^2) RSS for N regular expressions. * src/dfasearch.c (GEAcompile): Add new argument, and avoid unneeded compilation of regex. * src/grep.c (compile_fp_t): Update prototype. (main): Update caller. * src/kwsearch.c (Fcompile): Update caller and add new argument. * src/pcresearch.c (Pcompile): Add new argument. * src/search.h (GEAcompile, Fcompile, Pcompile): Update prototype.
* build: update gnulib to latestJim Meyering2020-09-221-0/+0
|
* tests: skip stack-overflow test on midnightbsd*Jim Meyering2020-09-222-0/+6
| | | | | | * tests/stack-overflow: skip_ when run on this OS. See details in https://lists.gnu.org/r/grep-devel/2020-09/msg00062.html * tests/Makefile.am (host_triplet): Export.
* doc: say how to match chars by codePaul Eggert2020-09-211-16/+68
| | | | | | | From a suggestion in Bug#41004. * doc/grep.texi (Character Encoding, Matching Non-ASCII): New sections. Move some material from Environment Variables into these sections.
* * src/dfasearch.c (struct dfa_comp): Fix out-of-date comment.Paul Eggert2020-09-181-1/+1
|
* grep: "grep '\)'" reports an error againPaul Eggert2020-09-182-0/+22
| | | | | | | * src/grep.c (try_fgrep_pattern): With -G, pass \) through to GEAcompile so that it can complain. This fixes an unexpected change in behavior from grep 3.4 and earlier. * tests/filename-lineno.pl: Add tests for this sort of thing.
* grep: tweak by using mempcpyPaul Eggert2020-09-181-4/+2
| | | | | * src/grep.c (try_fgrep_pattern): Tweak previous change by using mempcpy.
* grep: make echo .|grep '\.' match once againJim Meyering2020-09-183-0/+24
| | | | | | | | | | | | | | The same applied for many other backslash-escaped bytes, not just metacharacters. The switch to rawmemchr in v3.4-almost-10-g9393b97 made some parts of the code require the usually-guaranteed newline sentinel at the end of each pattern. Before, some consumers used a (correct) pattern length and did not care that try_fgrep_pattern could transform a pattern (with sentinel) like "\\.\n" to "..\n", thus violating that assumption. * src/grep.c (try_fgrep_pattern): Preserve the invariant that each regexp is newline-terminated. * tests/backslash-dot: New file. Test for this. * tests/Makefile.am (TESTS): Add it.
* tests: triple-backref: print a reference to glibc bugJim Meyering2020-09-181-0/+7
| | | | | * tests/triple-backref (MALLOC_CHECK_): And tell glibc not to bother with a core dump. Suggested by Pádraig Brady.
* grep: be more consistent about diagnostic formatPaul Eggert2020-09-185-13/+15
| | | | | | | | | | * NEWS: Mention this. * bootstrap.conf (gnulib_modules): Remove 'quote'. * src/grep.c: Do not include quote.h. (grep, grepdirent, grepdesc): Put the three unusual diagnostics into the same "grep: FOO: message" form that grep uses elsewhere. * tests/binary-file-matches, tests/in-eq-out-infloop: Adjust tests to match new diagnostic format.
* build: update gnulib to latestJim Meyering2020-09-171-0/+0
|
* * tests/triple-backref: Add comment.Paul Eggert2020-09-171-0/+4
|
* tests: make new test executable, to placate distcheckJim Meyering2020-09-171-0/+0
| | | | * tests/binary-file-matches: Make this executable.
* tests: add coverage for code that emits the new diagnosticJim Meyering2020-09-172-0/+22
| | | | | * tests/binary-file-matches: New file. * tests/Makefile.am (TESTS): Add it.
* maint: avoid syntax-check failureJim Meyering2020-09-171-1/+1
| | | | | | | | * src/grep.c (grep): Lower-case the "B" in "Binary file... matches" diagnostic that we now emit to stderr. This avoids the following when running "make syntax-check": maint.mk: found capitalized error message make: *** [maint.mk:469: sc_error_message_uppercase] Error 1
* Send "Binary file FOO matches" to stderrPaul Eggert2020-09-1710-28/+24
| | | | | | | | | | | * NEWS, doc/grep.texi: Mention this change (Bug#29668). * src/grep.c (grep): Send "Binary file FOO matches" to stderr instead of stdout. * tests/encoding-error, tests/invalid-multibyte-infloop: * tests/null-byte, tests/pcre-count, tests/surrogate-pair: * tests/symlink, tests/unibyte-binary: Adjust tests to match new behavior. In all cases this simplifies the tests, which is a good sign.