| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* src/grep.c (hash_pattern): Switch from PJW to DJB2, to avoid an
O(N) to O(N^2) performance regression due to hash collisions with
patterns from e.g., seq 500000|tr 0-9 A-J
Reported by Frank Heckenbach in https://bugs.gnu.org/44754
* NEWS (Bug fixes): Mention it.
* tests/hash-collision-perf: New file.
* tests/Makefile.am (TESTS): Add it.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
| |
* tests/ere.tests: Add new test.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
* tests/filename-lineno.pl: Remove a stray envvar
that somehow slipped into expected output string.
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
* tests/stack-overflow: Skip this test when the binary was built
with ASAN, to avoid spurious failures.
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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/many-regex-performance: New test for this performance
regression.
* tests/Makefile.am: Add it.
* NEWS (Bug fixes): Describe it.
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 (MALLOC_CHECK_): And tell glibc not to
bother with a core dump. Suggested by Pádraig Brady.
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
| |
|
|
|
|
| |
* tests/binary-file-matches: Make this executable.
|
|
|
|
|
| |
* tests/binary-file-matches: New file.
* tests/Makefile.am (TESTS): Add it.
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
| |
Problem reported by Jason Franklin (Bug#33552).
* NEWS: Mention this.
* src/grep.c (grep): Do not output "Binary file FOO matches" if -I.
* tests/encoding-error: Add test for this bug.
|
|
|
|
|
|
|
| |
Problem reported by Thomas Deutschmann (Bug#29446#23).
* src/pcresearch.c (Pexecute): Diagnose PCRE_ERROR_RECURSIONLIMIT.
* tests/pcre-jitstack: Treat recursion limit overflow like stack
overflow.
|
|
|
|
|
|
|
|
|
| |
Problem reported by Mayo Fark (Bug#43225).
* src/searchutils.c (wordchar_prev): In a UTF-8 locale, do not
assume that an encoding-error byte cannot be part of a word
constituent, as this assumption is incorrect for the last byte
of a multibyte word constituent.
* tests/word-delim-multibyte: Add a test for the bug.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Do not pass two copies of the same regexp to the
regular-expression engine. Although the engines should
perform nearly as well even with the copies, in practice they do not.
Problem reported by Luca Borzacchiello (Bug#43040).
* bootstrap.conf (gnulib_modules): Add hash.
* src/grep.c: Include stdint.h, for SIZE_WIDTH.
Include hash.h.
(struct patloc, patloc, patlocs_allocated, patlocs_used):
Rename from struct FL_pair, fl_pair, n_fl_pair_slots, n_pattern_files,
respectively, since the data type is no longer a pair.
All uses changed.
(struct patloc): New member FILELINE. The lineno member is now
ptrdiff_t since nowadays we prefer signed types.
(pattern_array, patterns_table): New static vars.
(count_nl_bytes, fl_add): Remove; no longer used.
(hash_pattern, compare_patterns, update_patterns): New functions.
update_patterns does what fl_add used to do, plus remove dups.
(pattern_file_name): Adjust to change from fl_pair to patloc.
(main): Move some variables to inner blocks for clarity.
Maintain the pattern_table hash of all patterns.
Update pattern_array to match keys, and use update_patterns
instead of fl_add to remove duplicate keys.
* tests/filename-lineno.pl (invalid-re-2-files)
(invalid-re-2-files2, invalid-re-2e): Ensure regexps are unique in
tests so that dups aren’t removed in diagnostics.
(invalid-re-line-numbers): New test.
|
|
|
|
|
|
|
|
|
| |
Problems reported by Antonio Diaz Diaz in:
https://bugs.gnu.org/28105#29
* NEWS, doc/grep.texi (Exit Status), src/grep.c (usage):
Adjust documentation accordingly.
* src/grep.c (grepdesc, main): Go back to old behavior.
* tests/skip-read: Adjust tests accordingly.
|
| |
|
|
|
|
|
|
|
| |
* tests/triple-backref: Add a 10 s timeout to work around
what appears to be a GCC bug with -fprofile-generate.
Problem reported by Martin Liška, with diagnosis by
Andreas Schwab (Bug#21513).
|
|
|
|
|
|
|
|
| |
Run "make update-copyright" and then...
* gnulib: Update to latest with copyright year adjusted.
* tests/init.sh: Sync with gnulib to pick up copyright year.
* bootstrap: Likewise.
* doc/grep.in.1: Use "-" in copyright year ranges, not \en.
|
|
|
|
|
| |
* tests/mb-non-UTF8-perf-Fw: Run twice, to avoid first-read penalty.
Reported by Nelson H.F. Beebe.
|
| |
|
|
|
|
|
| |
* gnulib: update
* tests/init.sh: Sync from gnulib (this removes the LC_ALL=C setting).
|
|
|
|
|
|
|
| |
* tests/grep-dev-null-out: Use a 10-second timeout, rather than
a 1-second one. This avoids false failure on slow systems.
Reported by Assaf Gordon in
https://lists.gnu.org/r/grep-devel/2019-12/msg00018.html
|
|
|
|
|
|
| |
* tests/surrogate-pair: Adjust to match fixed behavior
on AIX 7.2, where wchar_t is 16 bits and cannot represent
the test case data.
|
|
|
|
|
|
| |
* tests/backslash-s-vs-invalid-multitype: Rename to...
* tests/backslash-s-vs-invalid-multibyte: ...this.
* tests/Makefile.am (TESTS): Reflect renaming.
|
|
|
|
|
|
|
|
| |
* tests/mb-non-UTF8-perf-Fw: This test uses "timeout",
so must first call require_timeout_.
This avoids test spurious failure when running with
no timeout program. Reported by Bruno Haible in
https://lists.gnu.org/r/grep-devel/2019-12/msg00008.html
|
|
|
|
|
|
|
|
|
|
| |
AIX 7.2 /bin/sh’s printf command mishandles octal escapes
in multibyte locales: it treats them as characters, not bytes.
* tests/backslash-s-vs-invalid-multitype, tests/encoding-error:
Use the C locale when employing the printf command with an octal
escape that AIX 7.2 sh might mishandle.
* tests/init.sh (setup_): Use the C locale for tests.
This has the side benefit of making them more reproducible.
|
|
|
|
|
|
| |
* gnulib: Update submodule to latest.
* bootstrap: Copy from gnulib.
* tests/init.sh: Likewise.
|
|
|
|
|
| |
* tests/Makefile.am (TESTS): Alphabetize the new addition,
mb-non-UTF8-perf-Fw to placate syntax-check's sc_sorted_tests.
|
|
|
|
|
|
|
|
| |
Update Gnulib to latest. Also:
* src/dfasearch.c (EGexecute): Use ptrdiff_t, not size_t,
to match new Gnulib API.
* tests/Makefile.am (TESTS): Add dfa-invalid-utf8.
* tests/dfa-invalid-utf8: New file.
|
|
|
|
|
|
| |
* tests/mb-non-UTF8-perf-Fw: New file. Detect v3.3-22-g090a4db's
performance regression.
* tests/Makefile.am (TESTS): Add it.
|
|
|
|
|
| |
* tests/mb-non-UTF8-word-boundary: Also correct "introduced-in"
version number in a comment here.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For example, this command would erroneously print its input line:
echo ab | LC_CTYPE=ja_JP.eucjp grep -Fw b
This arose when the "memrchr" search for a preceding newline failed:
in that case, MB_START was not adjusted and was initially the same
as BEG, so wordchar_prev mistakenly returned 0.
* src/kwsearch.c (Fexecute): Set MB_START also when there is no
preceding newline.
* NEWS (Bug fixes): Mention it.
* tests/mb-non-UTF8-word-boundary: New file. Test for the bug.
* tests/Makefile.am (TESTS): Add it.
Reported by NIDE, Naoyuki in https://bugs.gnu.org/38223.
|
|
|
|
|
|
|
|
|
| |
Problem reported by Adam Sampson (Bug#37716).
* NEWS: Mention this.
* src/grep.c (grepdesc): Don’t assume that stdout being /dev/null
means list_files == LISTFILES_NONE.
(main): Do not change list_files merely because stdout is /dev/null.
* tests/skip-read: Test for this bug.
|
|
|
|
|
|
| |
* tests/pcre-jitstack: Don't let a stack overflow evoke a false
failure. This test is to ensure there is no internal PCRE error.
Reported by Andreas Schwab in http://bugs.gnu.org/34370
|
|
|
|
| |
* gnulib: Also update submodule for its copyright updates.
|
|
|
|
|
|
|
|
| |
Under some conditions, \b would mistakenly fail to match, e.g.
echo 123-x|LC_ALL=C grep '.\bx'
* NEWS (Bug fixes): Mention it
* gnulib: Update to latest, for DFA regression fix.
* tests/word-delim-multibyte: Add a test for the dfa.c regression.
|