| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PCRE2 has a bug when using PCRE2_MATCH_INVALID_UTF: it would
sometimes fail to match patterns using negative classes
like \W and \D.
* NEWS (Bug fixes): Mention it.
* src/pcre2search.c: Restrict impact of the bug.
Do not use the problematic flag with broken versions of PCRE2.
Also, generate locale tables only for single-byte locales,
as the PCRE2 documentation recommends this.
* tests/Makefile.am (TESTS): Add the file name
* tests/pcre-utf8-bug224: New file, to test for this.
|
|
|
|
|
|
|
|
|
|
| |
* src/grep.c: No need to include pcre2.h.
(main) [HAVE_LIBPCRE]: Call Pprint_version instead of
doing it ourselves.
* src/pcresearch.c (Pprint_version): New function.
It also checks belatedly for buffer overflow, and
says "grep -P uses PCRE2" instead of "Built with PCRE".
* tests/version-pcre: Adjust test to match.
|
|
|
|
|
|
| |
* tests/y2038-vs-32-bit: Skip rather than fail, when
the touch -t 2039... setup fails. That command failed
on a solaris10 sparc build farm host.
|
|
|
|
|
|
|
|
|
| |
* tests/glibc-infloop: New file.
Based on the command from Koen Claessen
reported in https://bugs.gnu.org/62483
* configure.ac (USE_INCLUDED_REGEX): define.
* tests/Makefile.am (TESTS): Add the file name
* THANKS.in: Add name of reporter.
|
|
|
|
|
|
|
|
|
|
| |
PCRE is integral to the functioning of grep's -P option, so it is in our
interest to make it easy to see which version of PCRE grep uses.
* src/grep.c [HAVE_LIBPCRE]: Include <pcre2.h>.
[HAVE_LIBPCRE] (main): Print pcre version info.
* tests/version-pcre: New test for this.
* tests/Makefile.am (TESTS): Add the file name.
* NEWS (Changes in behavior): Mention it.
|
|
|
|
|
| |
* tests/y2038-vs-32-bit: New file.
* tests/Makefile.am (TESTS): Add the file name
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Our prepass-based fixes for the -P \d bug have caused repeated
further bugs. Avoid the need for a prepass, by using PCRE2_UCP
only if PCRE2_EXTRA_ASCII_BSD is also supported. Since the -P \w
bug was present from grep 2.5 through 3.8 it’s OK if we wait a
little longer to fix it.
* NEWS: Mention this.
* src/pcresearch.c (pcre_pattern_expand_backslash_d}: Remove.
Remove its use.
(Pcompile): Use PCRE2_UCP only if PCRE2_EXTRA_ASCII_BSD.
* tests/pcre-ascii-digits, tests/pcre-utf8-w:
Skip tests on older PCRE2 implementations.
|
|
|
|
|
|
|
|
|
|
|
| |
* NEWS: Mention \D, too.
* doc/grep.texi: Likewise
* src/pcresearch.c (pcre_pattern_expand_backslash_d): Handle \D.
Also, ifdef-out this new function and its call site when not needed.
* tests/pcre-ascii-digits: Test \D, too.
Tighten one test by using returns_ 1.
Add comments and tests that work only with 10.43 and newer.
Paul Eggert raised the issue of \D in https://bugs.gnu.org/62267#8
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Prior to grep-3.9, the PCRE matcher had always treated \d just
like [0-9]. grep-3.9's fix for \w and \b mistakenly relaxed \d
to also match multibyte digits.
* src/grep.c (P_MATCHER_INDEX): Define enum.
(pcre_pattern_expand_backslash_d): New function.
(main): Call it for -P.
* NEWS (Bug fixes): Mention it.
* doc/grep.texi: Document it: with -P, \d matches only ASCII digits.
Provide a PCRE documentation URL and an example of how
to use (?s) with -z.
* tests/pcre-ascii-digits: New test.
* tests/Makefile.am (TESTS): Add that file name.
Reported as https://bugs.gnu.org/62267
|
|
|
|
|
| |
* tests/fmbtest: Don't use [x*n] syntax in the tr options, since tr from
BusyBox 1.35 does not support it.
|
|
|
|
|
|
| |
It’s obsolete in bleeding-edge Gnulib.
* src/grep.c, tests/get-mb-cur-max.c: Don’t include getprogname.h.
Instead, rely on stdlib.h to declare getprogname.
|
| |
|
|
|
|
|
| |
Do not use ‘test "" -eq 1’ when get-mb-cur-max fails,
as Bash complains about this. Problem found on AIX.
|
|
|
|
|
|
|
| |
* tests/hangul-syllable, tests/surrogate-search:
32-bit AIX has WCHAR_MAX == 0xFFFF, and so cannot handle
U+10000 and greater. Skip tests involving such chars
on this platform.
|
|
|
|
| |
* tests/init.sh: Update from Gnulib.
|
|
|
|
|
| |
* tests/skip-read: Omit duplicates. Reported by Bruno Haible in:
https://lists.gnu.org/r/grep-devel/2023-01/msg00003.html
|
|
|
|
|
|
| |
* tests/init.cfg (require_pcre_): When in a UTF-8 locale, test
also for Unicode support so that it can be diagnosed differently
(Bug#60708).
|
|
|
|
|
|
|
|
|
|
|
| |
Before this change, if linked with a PCRE library without unicode
any invocations of grep when using a UTF locale will error with:
grep: this version of PCRE2 does not have Unicode support
* src/pcresearch.c: Check whether Unicode was compiled in.
* tests/pcre-utf8-w: Add check to skip test.
* tests/pcre-utf8: Update check.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes a serious bug affecting word-boundary and word-constituent regular
expressions when the desired match involves non-ASCII UTF8 characters.
* src/pcresearch.c: Set PCRE2_UCP together with PCRE2_UTF
* tests/pcre-utf8-w: New file.
* tests/Makefile.am (TESTS): Add it.
* NEWS (Bug fixes): Mention this.
* THANKS.in: Add Gro-Tsen and Karl Petterson.
Reported by Gro-Tsen https://twitter.com/gro_tsen/status/1610972356972875777
via Karl Pettersson in https://github.com/PCRE2Project/pcre2/issues/185
This bug was present from grep-2.5, when --perl-regexp (-P) support was added.
|
| |
|
|
|
|
|
|
|
|
| |
* NEWS: Mention this.
* src/dfasearch.c (GEAcompile): Trim trailing newline from
the last pattern, even if it has back-references and follows
a pattern that lacks back-references.
* tests/backref: Add test for this bug.
|
|
|
|
|
|
|
|
| |
* tests/long-pattern-perf: Skip this test whenever the base
case takes more than 800ms. See comment for details.
Reported by Bruno Haible in
https://lists.gnu.org/r/grep-devel/2022-07/msg00004.html
https://lists.gnu.org/r/grep-devel/2022-07/msg00006.html
|
|
|
|
|
|
|
|
|
| |
* tests/long-pattern-perf: Don't fail due to a syntax error
when one of the subtests exhausts virtual memory. The larger
test (with a 2MiB regexp) needs about 870MiB of virtual memory.
Require that each timing run exit with status 0, else fail with
a framework_failure_. Reported by Bruno Haible in
https://lists.gnu.org/r/grep-devel/2022-07/msg00006.html
|
|
|
|
|
|
|
|
| |
* tests/triple-backref: I noticed that our sole XFAIL is still
required, in spite of a glibc comment that bug 11053 is fixed,
so confirmed that it no longer evokes an abort, but still fails
to produce the expected match. I.e., this prints nothing:
echo a | grep -E '(.?)(.?)(.?)\3\2\1' -- it should print its input.
|
|
|
|
| |
* tests/hash-collision-perf (ratio): Remove stray diagnostic.
|
| |
|
|
|
|
| |
* tests/Makefile.am (TESTS): Insert color-colors in sorted order.
|
| |
|
|
|
|
|
| |
* tests/Makefile.am (TESTS): Add it.
* tests/color-colors: New file.
|
|
|
|
|
|
|
| |
* tests/init.cfg (require_perl_): New function.
* tests/big-hole, tests/hash-collision-perf, tests/long-pattern-perf:
* tests/many-regex-performance, tests/mb-non-UTF8-performance:
Use it.
|
|
|
|
|
|
|
| |
* src/dfasearch.c (dfawarn): Always call dfaerror now,
regardless of POSIXLY_CORRECT.
* tests/warn-char-classes: Omit test of POSIX.1-2008 behavior,
since POSIX.1-2017 allows the GNU behavior.
|
|
|
|
|
|
|
| |
* tests/spencer1.tests: Do not test the regular expression a\x as
POSIX says the interpretation of \x is undefined and we may want
to warn about it in the future, to allow for future extensions.
Instead, test a\\x, a[\]x, and ax.
|
|
|
|
| |
* tests/hangul-syllable: Test some encoding errors too.
|
| |
|
|
|
|
|
|
| |
* NEWS: Mention the fix, which comes from the recent Gnulib update.
* tests/hangul-syllable: New file.
* tests/Makefile.am (TESTS): Add it.
|
|
|
|
|
|
|
|
|
|
|
| |
When calling xpalloc (NULL, &n, incr_min, alloc_max, 1) with
nontrivial ALLOC_MAX, this must hold: N + INCR_MIN <= ALLOC_MAX.
With a very long line, it did not, and grep would mistakenly fail
with a report of "memory exhausted".
* src/grep.c (fillbuf): When using nontrivial ALLOC_MAX, ensure it
is at least N+INCR_MIN.
* tests/fillbuf-long-line: New file, to test for this.
* tests/Makefile.am (TESTS): Add its name.
|
|
|
|
| |
* tests/empty: Test #4 is identical to test #1. Remove it.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
Cygwin does not support surrogate-pair search strings, so
skip the test there (Bug#27555).
* tests/Makefile.am (TESTS): Add surrogate-search.
* tests/surrogate-pair: Remove surrogate-search test,
which is now done by surrogate-search.
* tests/surrogate-search: New test, which is skipped on Cygwin.
|
|
|
|
|
| |
* src/grep.c (grep): Implement this.
* tests/binary-file-matches: Add regression test.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Mostly a bug by bug translation of the original code to the PCRE2 API.
Code still could do with some optimizations but should be good as a
starting point.
The API changes the sign of some types and therefore some ugly casts
were needed, some of the changes are just to make sure all variables
fit into the newer types better.
Includes backward compatibility and could be made to build all the way
to 10.00, but assumes a recent enough version and has been tested with
10.23 (from CentOS 7, the oldest).
Performance seems equivalent, and it also seems functionally complete.
* m4/pcre.m4 (gl_FUNC_PCRE): Check for PCRE2, not the original PCRE.
* src/pcresearch.c (struct pcre_comp, jit_exec)
(Pcompile, Pexecute):
Use PCRE2, not the original PCRE.
* tests/filename-lineno.pl: Adjust to match PCRE2 diagnostics.
|
|
|
|
| |
* tests/pcre-context: Initialize ‘fail’ earlier.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Included in the original bug #20957, but corrupted somehow in
transit as the required NUL characters are missing.
Add a simpler version of the test case that uses plain characters
and match the -z data and output to show the equivalence.
Note the output is still not correct as it is missing the expected
LF characters, but a full fix will have to wait until PCRE2.
Fixes Bug#51735.
|
|
|
|
|
|
| |
* tests/mb-non-UTF8-perf-Fw: Use head -n 10000000 rather than the
work-alike sed command. This provides a 4x speedup and saves 0.5s.
* tests/null-byte: Likewise.
|
|
|
|
|
| |
* tests/mb-non-UTF8-perf-Fw: Prefer ‘sed 10q’ to ‘head -10’,
which doesn’t conform to POSIX.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* NEWS: Mention this (see bug#49996).
* doc/Makefile.am (egrep.1 fgrep.1): Remove. All uses removed.
* doc/grep.in.1, doc/grep.texi (grep Programs):
Remove documentation for egrep, fgrep.
* doc/grep.texi (Usage): Add FAQ for egrep and fgrep.
* src/Makefile.am (shell_does_substrings): Substitute for ${0##*/},
not for ${0%/\*} (which was not being used anyway).
* src/egrep.sh: Issue an obsolescence warning.
* tests/fedora: Use "grep -F" instead of "fgrep" in diagnostics,
as this tests "grep -F" not "fgrep".
|
|
|
|
|
|
|
|
| |
...so we can continue to use seq, but the wrapper when needed.
* tests/init.cfg (seq): Some systems lask seq.
Provide a replacement.
* tests/hash-collision-perf: Use seq once again.
* tests/long-pattern-perf: Likewise. And remove a comment about seq.
|
|
|
|
|
|
|
| |
Portability problem reported by Dagobert Michelsen in:
https://lists.gnu.org/r/grep-devel/2021-08/msg00004.html
* tests/hash-collision-perf, tests/long-pattern-perf:
Don’t assume seq is installed; use awk instead.
|