40 Commits

Author SHA1 Message Date
Jim Meyering
c635f7dd92 maint: update copyright dates 2026-01-02 16:42:12 -08:00
Paul Eggert
b1eaccd96d maint: update all copyright dates via "make update-copyright" 2025-01-01 19:15:26 -08:00
Jim Meyering
e248db797a maint: update all copyright dates via "make update-copyright" 2024-01-05 09:19:41 -08:00
Jim Meyering
45e1158a4b maint: update copyright dates 2023-01-01 20:36:23 -08:00
Jim Meyering
656de767ee maint: po/POTFILES.in: add src/dfasearch.c to avoid syntax-check failure
* po/POTFILES.in: Add src/dfasearch.c.
2022-05-29 22:48:09 -07:00
Jim Meyering
f9290127f3 maint: make update-copyright 2022-01-01 10:29:09 -08:00
Paul Eggert
e84a2ea9d2 maint: run "make update-copyright" 2021-01-01 19:00:09 -08:00
Jim Meyering
5909bc45ad maint: update all copyright year number ranges
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.
2020-01-01 09:12:07 -08:00
Paul Eggert
8d8dc4c62e maint: adjust to recent Gnulib change
* po/POTFILES.in: Remove lib/xstrtol-error.c.
2019-12-18 00:08:21 -08:00
Jim Meyering
a37a439a7f build: update gnulib to latest
* po/POTFILES.in: Add lib/argmatch.h.
2019-11-08 17:54:24 -08:00
Jim Meyering
1019e6e35a maint: update all copyright dates via "make update-copyright"
* gnulib: Also update submodule for its copyright updates.
2019-01-01 19:00:38 -08:00
Paul Eggert
7a89c66674 maint: update URLs
Mostly this is just changing http: to https:.
In one or two places it removes no-longer-useful URLs.
2018-04-21 13:47:28 -07:00
Jim Meyering
e8feb1ce5c maint: update gnulib and copyright dates for 2018
* gnulib: Update to latest.
* all files: Run "make update-copyright".
* bootstrap: Update from gnulib.
2018-01-06 16:14:06 -08:00
Jim Meyering
51ef8adb2f grep: diagnose stack overflow rather than segfaulting
* bootstrap.conf (gnulib_modules): Add c-stack.
* src/grep.c: Include "c-stack.h".
(main): Call c_stack_action (NULL);
* tests/stack-overflow: New file.
* tests/Makefile.am (TESTS): Add name of new file.
* NEWS (Improvements): Mention it.
Interestingly, this bug does not afflict grep-2.5.4 or prior,
so it appeared to have been introduced with grep-2.6.  However,
the origin is in glibc's regexp compiler, and I tracked it to
stack-aware parsing that was removed from glibc's regexp in 2002.
However, grep-2.5.4 was released in 2009.  That version worked
(and still works, now) because it included and (by default) used
an old copy of glibc's regexp code.
Jeremy Feusi reported the grep segfault in https://bugs.gnu.org/29666.
I reported the glibc regexp bug in
https://sourceware.org/bugzilla/show_bug.cgi?id=22620
2017-12-16 11:28:52 -08:00
Jim Meyering
c0b45e4d78 maint: fix new syntax-check errors
* po/POTFILES.in: Add lib/xbinary-io.c.
* cfg.mk (FILTER_LONG_LINES): Add TODO to the list of exempt files.
2017-02-17 20:47:32 -08:00
Jim Meyering
3cd2e8625a maint: update gnulib and copyright dates for 2017
* gnulib: Update to latest.
* all files: Run "make update-copyright".
2017-01-01 03:34:33 -08:00
Jim Meyering
ca2ded9ca8 dfa: reflect move of grep's DFA code to gnulib
Now that the core DFA code and tests reside in gnulib,
remove the copies here and use what gnulib provides.
* bootstrap.conf: Use the dfa module.
* cfg.mk: Remove settings involving files that have moved.
(_gl_TS_unmarked_extern_functions): Add dfaerror and dfawarn.
It is wrong/ugly to have to define these global symbols to use
the dfa module, but we'll adjust that separately.
* po/POTFILES.in: Apply s/src/lib/ to src/dfa.c.
* src/Makefile.am: Remove mention of dfa.[ch] and localeinfo.[ch].
* tests/Makefile.am: Remove mention of the tests that we have
moved to the gnulib module.
* src/dfa.c: Remove file.
* src/dfa.h: Likewise.
* src/localeinfo.c: Likewise.
* src/localeinfo.h: Likewise.
* tests/dfa-match: Likewise.
* tests/dfa-match-aux.c: Likewise.
* tests/invalid-char-class: Likewise.
2016-09-10 11:03:43 -07:00
Jim Meyering
c65dcd72d1 maint: update copyright year, bootstrap, init.sh
Run "make update-copyright" and then...

* gnulib: Update to latest.
* tests/init.sh: Update from gnulib.
* bootstrap: Likewise.
2016-01-01 14:34:20 -08:00
Jim Meyering
d433dad3f4 maint: update copyright year ranges to include 2015
Run "make update-copyright".  Also, ...
* grep.texi: Update manually, converting each "--" to "-".
2015-01-01 18:55:33 -08:00
Jim Meyering
06d479820a maint: avoid sc_po_check syntax-check failure (kwset.c)
* po/POTFILES.in: Remove kwset.c from this list, since it
no longer contains a translatable diagnostic.
2014-04-08 10:36:03 -07:00
Paul Eggert
b639643840 egrep, fgrep: go back to shell scripts
Although egrep's and fgrep's switch from shell scripts to
executables may have made sense in 2005, it complicated
maintenance and recently has caused subtle performance bugs.
Go back to the old way of doing things, as it's simpler and more
easily separated from the mainstream implementation.  This should
be good enough nowadays, as POSIX has withdrawn egrep/fgrep and
portable applications should be using -E/-F anyway.
* po/POTFILES.in: Remove src/egrep.c, src/fgrep.c, src/main.c.
* src/Makefile.am (bin_PROGRAMS): Remove egrep, fgrep.
(bin_SCRIPTS): New macro.
(grep_SOURCES): Move searchutils.c, dfa.c, dfasearch.c, kwset.c,
kwsearch.c, pcresearch.c here from libgrep_a_SOURCES.
(egrep_SOURCES, fgrep_SOURCES, noinst_LIBRARIES, libgrep_a_SOURCES):
Remove.
(LDADD): Remove libgrep.a.
(egrep, fgrep): New rules.
(CLEANFILES): New macro.
* src/grep.c: Rename from src/main.c.
(usage, setmatcher, main):
Simplify, since there's now just one executable.
(Gcompile, Ecompile, Acompile, GAcompile, PAcompile, matchers):
Move here from the (removed) src/grep.c.
(compile_fp_t, execute_fp_t, struct matcher, matchers):
Move here from src/grep.h, as they no longer need to be public.
(struct matcher.name): Avoid one level of indirection/relocation.
(do_execute, main): Fix a performance bug when it was compiled
as 'fgrep', due to confusion about which matcher was which.
(main): Fix a performance bug with -P, likewise.
* src/grep.h (before_options, after_options): Remove.
* src/egrep.c, src/fgrep.c, src/grep.c: Remove.
2014-03-23 17:25:20 -07:00
Jim Meyering
d562c071b6 maint: update copyright dates for 2014
Do that by running "make update-copyright".
2014-01-01 14:54:47 -08:00
Jim Meyering
0b2d2da071 maint: update all copyright year number ranges
Run "make update-copyright".
2013-01-04 11:12:05 +01:00
Paul Eggert
c6e3ea61d9 grep: -r no longer follows symlinks; use fts
Change -r to follow only command-line symlinks, and by default to
read only devices named on the command line.  This is a simple
way to get a more-useful behavior when searching random
directories; the idea is to use 'find' if you want something fancy.
-R acts as before and gets a new alias --dereference-recursive.
The code now uses fts internally, so it is more robust and
faster with large hierarchies.
* .gitignore: Remove lib/savedir.c, lib/savedir.h.
* tests/symlink: New file
* Makefile.boot (LIB_OBJS_core): Remove isdir.o, savedir.o.
Perhaps other changes are needed too, but I'm not sure what
this makefile is for.
* NEWS: Document changes.
* doc/grep.texi (File and Directory Selection): Likewise.
* bootstrap.conf (gnulib_modules): Remove dirent, dirname, isdir, open.
Add fstatat, fts, openat-safer.
* lib/Makefile.am (libgreputils_a_SOURCES): Remove savedir.c, savedir.h.
* lib/savedir.c, lib/savedir.h: Remove.
* po/POTFILES.in: Add lib/openat-die.c.
* src/main.c: Include fcntl-safer.h, fts_.h.  Don't include
isdir.h, savedir.h.
(struct stats, stats_base): Remove.
(long_options, usage, main): Add --dereference-recursive and
implement -r vs -R.
(filename_prefix_len, fts_options): New static vars.
(basic_fts_options, READ_COMMAND_LINE_DEVICES): New constants.
(devices): Now defaults to READ_COMMAND_LINE_DEVICES.
(reset, grep): Now takes just struct stat rather than file name and
struct stats.  All callers changed.
(fillbuf): Now takes struct stat reather than struct stats.
All callers changed.
(grep): Don't worry about recursing too deeply; fts and grepdesc
handle this now.
(is_device_mode, grepdirent, grepdesc, grep_command_line_args):
New functions.
(grepfile): New args DIRDESC, FOLLOW, COMMAND_LINE.  Remove struct stats
arg.  All callers changed.  Use openat_safer rather than open.
Use desc == STDIN_FILENO to tell whether we're reading "-".
Don't worry about EINTR when closing -- not possible, since we're
not catching signals.
* tests/Makefile.am (TESTS): Add symlink.
* tests/symlink: New file.
2012-03-14 22:28:27 -07:00
Jim Meyering
5b2201913f maint: update all copyright year number ranges
Run "make update-copyright".
2012-01-01 09:28:52 +01:00
Jim Meyering
7d639afd49 maint: update po/POTFILES.in
* po/POTFILES.in: Remove dfasearch.c, now that it no longer
contains a translatable diagnostic.
2011-06-21 11:19:21 +02:00
Jim Meyering
daaf7ce73d maint: update copyright year ranges to include 2011
Run "make update-copyright", so "make syntax-check" works in 2011.
2011-01-03 22:18:55 +01:00
Jim Meyering
85e0be5427 maint: add lib/version-etc.c to the list in POTFILES.in
* po/POTFILES.in: Add lib/version-etc.c.
2010-09-01 19:02:38 +02:00
Jim Meyering
f95776680c maint: fix new argmatch-related syntax-check failures
* configure.ac (ARGMATCH_DIE): Use usage(EXIT_FAILURE), not exit(1).
* po/POTFILES.in: Add lib/argmatch.c.
2010-04-05 12:02:44 +02:00
Paolo Bonzini
29e920cd16 grep: rename files for intuitiveness
* Makefile.am (libgrep_a_SOURCES, grep_SOURCES, egrep_SOURCES,
fgrep_SOURCES): Adjust.
* grep.c: Rename to main.c.
* esearch.c: Rename to egrep.c.
* fsearch.c: Rename to fgrep.c.
* gsearch.c: Rename to grep.c.
2010-03-22 10:21:17 +01:00
Paolo Bonzini
39fba7b612 grep: kill GREP_PROGRAM/EGREP_PROGRAM/FGREP_PROGRAM
* NEWS: Document slight semantic change.
* TODO: #ifdefs are gone.
* po/POTFILES.in: Update.
* src/Makefile.am (grep_SOURCES, egrep_SOURCES, fgrep_SOURCES): Remove
grep.c/egrep.c/fgrep.c.
(noinst_LIBRARIES): Change libsearch.a to libgrep.a.
(libsearch_a_SOURCES): Rename to libgrep_a_SOURCES, add grep.c
(LDADD): Change libsearch.a to libgrep.a.
* src/esearch.c: Add before_options and after_options.
* src/fsearch.c: Likewise.
* src/gsearch.c: Likewise.
* src/grep.c (short_options, long_options): Remove GREP_PROGRAM
special-casing.
(usage): Use before_options and after_options, look at matchers.
(setmatcher): Merge with install_matcher.
(main): Call setmatcher (NULL) instead of install_matcher.
* src/grep.h (GREP_PROGRAM): Remove.
(before_options, after_options): Add.
2010-03-22 10:21:16 +01:00
Paolo Bonzini
c59a6cd03d grep: split search.c
* po/POTFILES.in: Update.
* src/Makefile.am (grep_SOURCES, egrep_SOURCES, fgrep_SOURCES): Move
kwset.c and dfa.c to libsearch.a.  Add searchutils.c there too.
* src/search.h, src/dfasearch.c, src/pcresearch.c, src/kwsearch.c,
src/searchutils.c: New files, split out of src/search.c.
* src/esearch.c, src/fsearch.c: Include the new files instead of search.c.
* src/gsearch.c: Likewise, plus move Gcompile/Acompile here.
2010-03-22 09:55:30 +01:00
Jim Meyering
967f0d59b6 maint: use regex from gnulib, rather than our bit-rotting one
* bootstrap.conf (gnulib_modules): Add regex.
* configure.ac: Don't use jm_INCLUDED_REGEX.
Update use of cache variable.
* lib/regex.c: Remove file.
* lib/regex.h: Likewise.
* m4/regex.m4: Likewise.
* POTFILES.in: Update to match.
2010-02-03 21:32:57 +01:00
Jim Meyering
438dba06da maint: update all FSF copyright year lists to include 2010
Use this command:
git ls-files |grep -vE '^(\..*|COPYING|gnulib)$' |xargs \
env UPDATE_COPYRIGHT_USE_INTERVALS=1 build-aux/update-copyright
2010-01-01 16:20:57 +01:00
Jim Meyering
196b828887 maint: enable po-check
* cfg.mk (local-checks-to-skip): Enable sc_po_check.
* po/POTFILES.in: Sort and update.
2009-12-04 09:20:32 +01:00
Karl Berry
e93a3ad5c4 update/add copyright notices 2009-01-30 01:46:02 +00:00
Tony Abou-Assaleh
128b559cdd * po/POTFILES.in: -lib/getopt1.c 2008-02-15 03:10:15 +00:00
Tony Abou-Assaleh
068da0d775 * po/POTFILES.in: +src/system.h +lib/closeout.c +lib/regex.c
+lib/xmalloc.c

* po/POTFILES.in: +src/system.h +lib/closeout.c +lib/regex.c
  +lib/xmalloc.c
2008-02-14 04:49:36 +00:00
Alain Magloire
5268bcc11c 2001-03-04 05:38:14 +00:00
Alain Magloire
06b9f7e683 Initial revision 1998-11-03 21:38:52 +00:00