2483 Commits

Author SHA1 Message Date
Jim Meyering
071ac3aa76 also update bootstrap from gnulib 2026-01-02 16:50:40 -08:00
Jim Meyering
c635f7dd92 maint: update copyright dates 2026-01-02 16:42:12 -08:00
Jim Meyering
37b95973aa build: update gnulib to latest 2026-01-02 16:42:12 -08:00
Bruno Haible
22533e58ff build: Respect gnulib code ownership.
* gnulib-tests/Makefile.am (AM_CFLAGS): Don't augment after including
gnulib.mk.
2025-11-12 14:11:09 -08:00
Jim Meyering
e6d5e6809b build: update gnulib to latest 2025-11-12 14:11:09 -08:00
Paul Eggert
07a3bb2b44 build: use -Wtrailing-whitespace
* configure.ac: With --enable-gcc-warnings,
use GCC 15’s -Wtrailing-whitespace if available.
2025-10-16 08:10:16 -07:00
Paul Eggert
8185556858 doc: update troff comment
* doc/grep.in.1: Update troff comment.
Reported by G. Branden Robinson (Bug#79608).
2025-10-10 15:07:58 -07:00
Collin Funk
275600f387 maint: fix Automake warning
Avoid this warning: escaping \# comment markers is not portable
* Makefile.am (prologue): Remove macro.
(THANKS): Use the perl command directly.
2025-07-07 11:10:00 -07:00
Bruno Haible
db5172dc2b maint: use module 'kwset' from gnulib
* bootstrap.conf (gnulib_modules): Add kwset.
* src/kwset.h: Remove file.
* src/kwset.c: Remove file.
* src/Makefile.am (grep_SOURCES): Remove kwset.c.
(noinst_HEADERS): Remove kwset.h.
2025-06-26 06:36:50 -07:00
Jim Meyering
1665c885f2 build: update gnulib to latest, and update bootstrap from gnulib 2025-06-26 06:36:50 -07:00
Jim Meyering
682f7f693d tests: write-error-msg: avoid false-failure
* tests/write-error-msg: Do not require that a disk full
diagnostic include additional information. In some cases, there
is no valid errno value, so we cannot provide more information.
This was exposed by a patch that coincidentally caused the length
of grep's help output to be precisely 4096 bytes long.
Reported in https://bugs.gnu.org/77800
2025-05-14 10:56:16 -07:00
Paul Eggert
335fcd3f53 build: port to pkg.m4 serial 12
Problem reported by Bruno Haible in:
https://lists.gnu.org/r/grep-devel/2025-04/msg00005.html
* bootstrap.conf (bootstrap_post_import_hook):
Simplify. Don’t recommend against pkg.m4 serial 12,
since the following patches port to it.
* configure.ac: Don’t fail if pkg-config is missing.
* m4/pcre.m4 (gl_FUNC_PCRE): If pkg-config works use that;
otherwise if PCRE_CFLAGS='' PCRE_LIBS='-lpcre2-8' use that;
otherwise don’t use PCRE.
2025-04-19 23:15:35 -07:00
Paul Eggert
2e19d07ef1 build: update gnulib submodule to latest 2025-04-19 23:15:35 -07:00
Jim Meyering
b871c3e428 maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2025-04-10 09:04:07 -07:00
Jim Meyering
3f8c09ec19 version 3.12
* NEWS: Record release date.
v3.12
2025-04-10 09:01:30 -07:00
Jim Meyering
bd7250ca36 tests: mb-non-UTF8-perf-Fw: undo previous change
* tests/mb-non-UTF8-perf-Fw: Ugh. I misread the code and
didn't even test.  Given circumstances and the new timing that's
well within the 30-second timeout, I think there's no point
in trying to accommodate systems that are so overburdened they
trigger this failure. Reported by Grisha Levit.
2025-04-09 09:58:53 -07:00
Jim Meyering
f8bb8c519e tests: mb-non-UTF8-perf-Fw:: avoid false failure on overloaded systems
* tests/mb-non-UTF8-perf-Fw: Raise timeout from 1 to 3s
to accommodate slow systems.  Reported by Nelson Beebe in
https://lists.gnu.org/r/grep-devel/2025-04/msg00027.html
2025-04-09 09:05:57 -07:00
Jim Meyering
082f068a5e build: fix module name typo
* bootstrap.conf (gnulib_modules): Fix module name typo I introduced.
s/realloc-gnu-h/realloc-posix/. Reported by Bruno Haible in
https://bugs.gnu.org/77654
2025-04-08 13:31:37 -07:00
Jim Meyering
dc292e8bb0 build: avoid new bootstrap failure
* bootstrap.conf (bootstrap_post_import_hook): Append "|| :", fixing
my previous change. Otherwise, bootstrap would fail with this:
./bootstrap: bootstrap_post_import_hook failed
2025-04-08 13:29:32 -07:00
Bruno Haible
b1dee0f8b3 doc: temper a Unicode support claim: it's not quite done
* NEWS: clarify that the "Unicode characters outside the Basic
Multilingual Plane" item is not quite done.
2025-04-08 11:06:04 -07:00
Jim Meyering
b197be563e tests: hash-collision-perf: avoid test hang on GNU/Hurd
This test would hang on GNU/Hurd because the perl code we use to measure
subsecond duration isn't ported, and that loop would never terminate.
* tests/hash-collision-perf: Detect the always-0 small_ms, and skip the test.
Reported by Bruno Haible in https://bugs.gnu.org/77613
2025-04-08 09:32:24 -07:00
Jim Meyering
52418599b3 grep: avoid regression with -mN and any of -q, -l, -L
* src/grep.c (grepbuf): Handle this case: echo x|grep -l -m1 .
making it print only the file name, and not the matched line.
(main): Set out_quiet also when exit_on_match (-q) is set, so
"echo x|grep -q -m1 ." no longer prints the matched line.
* tests/max-count-overread: Add those tests, from
https://bugs.gnu.org/68989#21
2025-04-08 09:32:24 -07:00
Jim Meyering
a4628e58dd build: avoid using pkg-config's pkg.m4 serial 12
* bootstrap.conf (bootstrap_post_import_hook): Add code to ensure we
do not use pkg.m4 serial 12. For the record, I've temporarily copied
the version of pkg.m4 from grep-3.11 into $(aclocal --print-ac-dir),
so that when I run bootstrap, it always gets that serial 11 version.
Reported by Bruno Haible in
https://lists.gnu.org/r/grep-devel/2025-04/msg00005.html
2025-04-06 18:45:29 -07:00
Jim Meyering
05f8c68183 build: update gnulib to latest 2025-04-04 14:22:48 -07:00
Jim Meyering
2f5068b6ea maint: ensure that new "make syntax-check"-run sc_codespell passes
* cfg.mk (codespell_ignore_words_list): Ignore some false-positives.
2025-03-27 20:57:13 -07:00
Jim Meyering
50c4df64c1 build: use gnulib's new c-strcasecmp module, rather than c-strcase
* bootstrap.conf (gnulib_modules): Use new c-strcasecmp module, rather
than c-strcase, since grep uses c_strcasecmp and not c_strncasecmp.
2025-03-25 19:17:55 -07:00
Jim Meyering
6de7c9d48b build: update gnulib to latest; and update bootstrap 2025-03-25 19:17:55 -07:00
Jim Meyering
ffb27fd225 grep: remove long-deprecated --unix-byte-offsets (-u) option
* src/grep.c (main): Remove vestiges of --unix-byte-offsets (-u).
In grep-3.7 (2021-08-14) it became a warning-only no-op.
Before then, it was a Windows-only no-op.
* NEWS (Changes in behavior): Mention it.
2025-03-25 19:11:38 -07:00
Paul Eggert
920daa57a4 doc: update man for groff 1.23.0 and apostrophes
* doc/grep.in.1: Merge from groff 1.23.0 tmac/an-ext.tmac.
On Groff, fix usage neutral apostrophes;
they cannot be reliably fixed in traditional troff.
2025-03-21 13:17:03 -07:00
Paul Eggert
9863d53a5f doc: use \w@...@ not \w|...|
* doc/grep.in.1: Avoid warnings in bleeding-edge groff.
2025-03-21 13:17:03 -07:00
Paul Eggert
ef595c086b doc: fix troff typo
* doc/grep.in.1: .BR → .B (Bug#77000).
2025-03-21 09:36:24 -07:00
Jim Meyering
5cc5251d5d grep: support gnulib-l10n
* src/grep.c (main): Call bindtextdomain for gnulib-l10n.
2025-02-08 20:13:17 -08:00
Jim Meyering
3160603308 maint: continue writing base64-encoded checksums to announcement
* cfg.mk (announce_gen_args): Set to --cksum-checksums.
2025-02-08 20:07:49 -08:00
Jim Meyering
0747169015 build: update gnulib to latest; and update bootstrap 2025-02-01 21:22:11 -08:00
Jim Meyering
006951de68 maint: reflect gnulib module renamings
* bootstrap.conf: Some gnulib modules are now deprecated, in
favor of new names with a "-h" suffix (and stdbool->bool).
Induce this change with the following:
  re='inttypes|locale|realloc-gnu|stdckdint|stddef|stdlib|string'
  re="$re|sys_stat|unistd"
  perl -pi -e 's{^('"$re"')$}{$1-h};s{^stdbool$}{bool}' bootstrap.conf
2025-02-01 16:53:44 -08:00
Jim Meyering
fc6aba9000 doc: clarify a --help sentence
* src/grep.c (usage): Prompted by a suggestion at
https://bugs.gnu.org/75582 by Anton Samokat.
* THANKS.in: Add that name.
2025-01-15 21:00:17 -08:00
Paul Eggert
b1eaccd96d maint: update all copyright dates via "make update-copyright" 2025-01-01 19:15:26 -08:00
Paul Eggert
ba98ec78f5 maint: update bootstrap from Gnulib
* bootstrap: sync from Gnulib
2025-01-01 19:15:26 -08:00
Paul Eggert
ad030d9bbb build: update gnulib submodule to latest 2025-01-01 19:15:26 -08:00
Paul Eggert
6ee856200a grep: revert recent \d change
I misread the email thread and thought there was consensus
for the \d change, but there was wasn’t so revert the change.
Also, document the resulting confusion
somewhat better than it was documented before.
* src/pcresearch.c, tests/pcre-ascii-digits, tests-pcre-utf8-w:
Revert recent \d change, restoring the behavior to that of grep 3.11.
2024-12-16 14:43:00 -07:00
Paul Eggert
19e301ad53 doc: give an example non-ASCII digit
* doc/grep.texi: Give ‘٣’ as an example of a non-ASCII digit.
2024-12-16 14:36:49 -07:00
Paul Eggert
421b2993e2 doc: don’t send “ſ” to PDF
* doc/grep.texi: Don’t output “ſ” (U+017F LATIN SMALL LETTER LONG S)
to PDF, since pdfTeX can’t handle it.
2024-12-16 13:25:26 -07:00
Paul Eggert
aa203fdaa9 doc: more improvements for -P discussion
* doc/grep.texi (grep Programs): Also mention git grep
and pcre2grep.
2024-12-16 01:41:37 -07:00
Paul Eggert
7ddaa55cab doc: improve -P discussion
* doc/grep.texi (grep Programs): Improve discussion of how grep -P
differs from Perl.
2024-12-14 14:15:00 -07:00
Paul Eggert
eaca869822 grep: go back to 3.9 -P '\d' behavior
Treating \d differently from Perl was more trouble than it was worth.
* NEWS, doc/grep.texi (grep Programs): Document this.
* src/pcresearch.c (PCRE2_EXTRA_ASCII_BSD):
Remove.  All uses removed.
* tests/pcre-ascii-digits: Adjust to this change.
* tests/pcre-utf8-w: Revert to 3.9.
2024-12-14 14:15:00 -07:00
Grisha Levit
29a9b72db3 tests: fix define for glibc-infloop
* configure.ac (USE_INCLUDED_REGEX): fix condition for definition.
This doesn't affect anything right now since the value is examined
only by an unconditionally skipped test.
2024-11-26 16:15:02 -08:00
Paul Eggert
24deafb92f doc: more consistent style for ‘...’
Problem reported by Martin Schulte <https://bugs.gnu.org/74205>.
* doc/grep.in.1, doc/grep.texi:
Use a more consistent style for [OPTION]... and [FILE]... in usage.
This doesn’t match what POSIX does but seems to be common in GNU doc.
Also, ‘...’ -> ‘@dots{}’ in grep.texi.
2024-11-04 13:52:19 -08:00
Paul Eggert
fce28c4a5e grep: fix -q suppression of diagnostics
Problem reported by Jan Černohorský (Bug#74159).
* src/grep.c (grepbuf): If exit_on_match, set stdout_errno to
avoid screwups on buggy OSes.  Also, ignore errseen since it
cannot be true here.
(main): Do not clear exit_failure if -q is given, as exit status
should be zero only if an input line is selected.
* tests/write-error-msg: Check that -q suppresses diagnostics
of output errors only if a match is found.
2024-11-01 22:46:33 -07:00
Paul Eggert
944c2eccc7 doc: warn re using ‘grep’ to detect binary files
This is in response to a bug report by Rodrigo Jorge
<https://bugs.gnu.org/73360>.
* doc/grep.texi (File and Directory Selection):
Warn that ‘grep’ shouldn’t be used to determine whether
a file is binary for other applications’ purposes, as
their definition of “binary” may well differ.
Improve documentation for discovery of null input.
2024-09-21 23:28:03 -07:00
Paul Eggert
8fb15fb5bf grep: avoid huge reads
The previous code could call 'read' with a nearly unbounded size
if the input had long lines, and this unbounded size persisted
from one file to the next once the input buffer grew.
This could have bad effects on the CPU's data cache,
and also could cause 'grep' to make counterintuitive decisions as
to whether a file is binary <https://bugs.gnu.org/73360>.
Instead, pick a good read size and stick with it; this is
more consistent, and more likely to fit in a cache.
* src/grep.c (good_readsize): New static var.
(GOOD_READSIZE_MIN): Rename from INITIAL_BUFSIZE.  All uses changed.
(fillbuf): Read good_readsize bytes rather than trying to
fill the rest of the input buffer.
(drain_input): Read good_readsize rather than GOOD_READSIZE_MIN
bytes.
(main): Initialize good_readsize.
2024-09-21 23:28:03 -07:00