| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
This is a better fix for Bug#34285.
* bootstrap.conf (gnulib_modules): Add c-strcase.
* src/grep.c: Include c-strcase.h, not strings.h.
(main): Use c_strcasecmp, not strcasecmp.
|
|
|
|
| |
* gnulib: Also update submodule for its copyright updates.
|
|
|
|
|
|
|
|
|
| |
Problem found by OpenCSW buildbot; the bug also occurs on GNU/Linux
build platforms. The symptom is “system.h:26:24: fatal error:
configmake.h: No such file or directory”. See:
https://buildfarm.opencsw.org/buildbot/builders/ggrep-solaris10-sparc/builds/107
* bootstrap.conf: Add configmake, a dependency that was formerly brought
in only by accident.
|
|
|
|
|
| |
Mostly this is just changing http: to https:.
In one or two places it removes no-longer-useful URLs.
|
|
|
|
|
|
| |
* gnulib: Update to latest.
* all files: Run "make update-copyright".
* bootstrap: Update from gnulib.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
gnulib recently gained a module, windows-stat-inodes, that fixes
directory recursion on MS-Windows. No changes to grep's C sources are
required; grep simply needs to request the module during configuration.
When grep requests this module, its configure script will gain the
behavior that was implemented in windows-stat-inodes.m4. This detects
mingw and sets WINDOWS_STAT_INODES=1. All other platforms are
unaffected, setting WINDOWS_STAT_INODES=0 (which is what's happening
in the absence of this patch).
* bootstrap.conf (gnulib_modules): Add windows-stat-inodes.
* NEWS (Bug fixes): Mention it.
Thanks to Pär Björklund who diagnosed the problem as involving inodes,
and thanks to Václav Haisman who provided the bootstrap.conf patch.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Inspired by a suggestion by Eric Blake (Bug#25707#17).
* bootstrap.conf (gnulib_modules): Add xbinary-io,
and remove binary-io and xfreopen.
* doc/grep.texi (Other Options):
Fix typo and reword to be a bit more general.
* src/grep.c: Include xbinary-io.h instead of xfreopen.h.
(grepfile): Open with O_BINARY if binary.
(grepdesc): No need for set_binary_mode now.
(grep_command_line_arg, main): Set stdin to binary mode if binary.
(main): Avoid unnecessary test of stdin == NULL.
Use xsetmode instead of xfreopen.
* src/system.h: Do not include binary-io.h.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Suggested by Eric Blake (Bug#25707#11).
* NEWS, doc/grep.texi: Document this.
* src/dosbuf.c: Remove.
* bootstrap.conf (gnulib_modules): Add xfreopen.
* src/grep.c: Include xfreopen.h, not dosbuf.c.
(fillbuf, print_line_head): Do not undossify input.
(binary): New static var.
(grepdesc): Apply BINARY to input file.
(usage): Remove -u help.
(main): Set BINARY if -U, and apply it to stdout. Do nothing if -u.
With -f, apply BINARY to input file.
|
|
|
|
|
| |
* gnulib: Update to latest.
* all files: Run "make update-copyright".
|
|
|
|
|
|
|
|
|
| |
* src/pcresearch.c (die): New macro.
(Pexecute): Use it in place of offending uses of error,
to placate GCC 7's -Wimplicit-fallthrough.
Include verify.h. Since this is grep's first explicit use of this
gnulib module, ...
* bootstrap.conf (gnulib_modules): Add verify.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
* gnulib: Update to latest, for its new getprogname module.
* bootstrap.conf (avoided_gnulib_modules): Include the getprogname
module rather than the now-obsolescent progname.
* src/grep.c: Include "getprogname.h" rather than "progname.h"
and remove any use of set_program_name.
* tests/dfa-match-aux.c (main): Likewise.
* tests/get-mb-cur-max.c (main): Likewise.
* src/grep.c (usage, main): Use getprogname() in place of program_name.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
MirOS BSD btowc is a macro that (when GCC is being used) hardcodes
btowc (0x80) == WEOF regardless of locale, which contradicts
future POSIX in the C locale. Instead of bothering to develop a
Gnulib workaround for the btowc incompatibility, use mbrtowc,
which we are using elsewhere and fixing anyway, and are caching so
it is fast here. Problem reported by Nelson H. F. Beebe via Jim
Meyering in: http://bugs.gnu.org/23269#14
* bootstrap.conf (gnulib_modules): Remove btowc.
* src/dfa.c (struct dfa): Remove mbrtowc_cache member, replacing with ...
(mbrtowc_cache): ... this new static var. All uses changed.
(dfambcache): Remove; now done by setsyntax. Call removed.
(is_valid_unibyte_character): Remove.
(IS_WORD_CONSTITUENT): Remove this macro, replacing it with ...
(unibyte_word_constituent): ... this new function. It uses
mbrtowc_cache rather than btowc.
(dfasyntax): Initialize mbrtowc_cache before using it.
|
|
|
|
|
|
|
| |
This test does not check how 'grep' itself operates, so it is
out of place for grep's 'make check'. Problem reported by Sam Razavi in:
http://bugs.gnu.org/22376
* bootstrap.conf (avoided_gnulib_modules): Add update-copyright-tests.
|
|
|
|
|
|
|
|
| |
Run "make update-copyright" and then...
* gnulib: Update to latest.
* tests/init.sh: Update from gnulib.
* bootstrap: Likewise.
|
|
|
|
|
|
|
|
|
|
| |
Running ./bootstrap could fail mistakenly at the very end in
its attempt to obtain a copy of pkg.m4. It would search only
$(aclocal --print-ac-dir) and some other directories, but not
those listed in $(aclocal --print-ac-dir)/dirlist.
* bootstrap.conf (bootstrap_post_import_hook): Also search the
directories named in $(aclocal --print-ac-dir)/dirlist when that
file exists with nonzero size.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem reported by Mike Frysinger in: http://bugs.gnu.org/16757
* bootstrap.conf (bootstrap_post_import_hook):
Copy pkg-config's pkg.m4.
* configure.ac: Invoke PKG_PROG_PKG_CONFIG.
* m4/pcre.m4 (gl_FUNC_PCRE): Rewrite to use pkg-config if
available, and to test that pcre_compile can be linked to.
* src/Makefile.am (AM_CFLAGS): Add PCRE_CFLAGS.
(grep_LDADD): Add PCRE_LIBS.
* src/pcresearch.c: Simply include <pcre.h> if HAVE_LIBPCRE,
since 'configure' arranges for the appropriate -I option now.
|
|
|
|
|
| |
Run "make update-copyright". Also, ...
* grep.texi: Update manually, converting each "--" to "-".
|
|
|
|
|
|
|
|
|
| |
glibc has a bug where mbrlen and mbrtowc mishandle length-0 inputs.
Working around it in gnulib slows grep down, so disable the tests for it
and make sure grep works even if the bug is present.
* bootstrap.conf (avoided_gnulib_modules): Add mbrtowc-tests.
* configure.ac (gl_cv_func_mbrtowc_empty_input): Assume yes.
* src/searchutils.c (mb_next_wc): Don't invoke mbrtowc on empty input.
|
|
|
|
|
|
| |
* bootstrap.conf (gnulib_modules): Add fdl.
* doc/fdl.texi: Remove, as this now comes from gnulib.
* doc/.gitignore: Update to match current sources.
|
|
|
|
|
|
|
|
|
| |
Problem reported by Norihiro Tanaka in: http://bugs.gnu.org/17700
* NEWS: Document this.
* bootstrap.conf (gnulib_modules): Add strstr.
* src/dfa.c (istrstr): Remove.
(enlist): Use strstr instead. Wait until we need memory before
allocating it; this can save an unnecessary allocate and free.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Idea suggested by Eric Blake in: http://bugs.gnu.org/17229#43
* bootstrap.conf (gnulib_modules): Add memchr2.
* src/kwset.c: Include stdint.h, for uintptr_t. Include memchr2.h.
(struct kwset): New members gc1, gc2, gc1help.
(tr): Move earlier, so it can be used earlier.
(kwsprep): Initialize struct kwset's new members.
(memchr_kwset): Rename from memchr_trans. Combine C and TRANS args into
new arg KWSET. All uses changed. Use memchr2 when appropriate.
(bmexec): Use new members instead of recomputing their values.
Increase advance_heuristic; it's just a guess, but memchr2 probably
makes it reasonable to increase it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This optimization is no longer needed, given the other
optimizations recently installed. Derived from a patch by
Norihiro Tanaka; see <http://bugs.gnu.org/17019>.
* bootstrap.conf (gnulib_modules): Remove assert-h.
* src/dfa.c (CASE_FOLDED_BUFSIZE): Move here from dfa.h.
Remove now-unnecessary static assert.
(case_folded_counterparts): Now static.
* src/dfa.h (CASE_FOLDED_BUFSIZE, case_folded_counterparts):
Remove decls; no longer public.
* src/dfasearch.c (kwsmusts): Use kwset even if fill MB_CUR_MAX > 1
and case-insensitive.
* src/grep.c (MBRTOWC, WCRTOMB): Remove.
(fgrep_to_grep_pattern): Use mbrtowc, not MBRTOWC.
(trivial_case_ignore): Remove; this optimization is no longer needed.
All uses removed.
|
|
|
|
|
|
|
|
|
| |
* bootstrap.conf (gnulib_modules): Add assert-h, to accommodate the
new use of static_assert on systems lacking support for that construct.
Without this change, compilation of dfa.c failed on OS X 10.8.5 with
gcc-4.9.0 20140324. We should be using gnulib's assert-h module,
regardless, for its nominal improved portability, since grep includes
assert.h and uses assert.
|
|
|
|
| |
Do that by running "make update-copyright".
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When trying to exercize some long-line-handling code, I ran these
commands:
$ dd bs=1 seek=2G of=big < /dev/null; grep -l x big; echo $?
grep: big: Invalid argument
2
grep should not have issued that diagnostic, and it should
have exited with status 1, not 2. What happened?
grep read the 2GiB of NULs, doubled its buffer size,
copied the 2GiB into the new 4GiB buffer, and proceeded
to call "read" with a byte-count argument of 2^32.
On at least Darwin 12.5.0, that makes read fail with EINVAL.
The solution is to use gnulib's safe_read wrapper.
* src/main.c: Include "safe-read.h"
(fillbuf): Use safe_read, rather than bare read. The latter
cannot handle a read size of 2^32 on some systems.
* bootstrap.conf (gnulib_modules): Add safe-read.
* tests/long-line-vs-2GiB-read: New file.
* tests/Makefile.am (TESTS): Add it.
* NEWS (Bug fixes): Mention it.
|
|
|
|
| |
* bootstrap.conf (gnulib_modules): Remove wcscoll; no longer used.
|
|
|
|
|
|
|
| |
* gnulib: Update submodule to latest.
* bootstrap: Update from gnulib.
* gl/lib/regex_internal.h.diff: Update to reflect gnulib changes.
* bootstrap.conf: Partial sync from coreutils.
|
|
|
|
| |
Run "make update-copyright".
|
|
|
|
|
|
|
|
| |
* tests/big-hole: Test for SEEK_HOLE support. If not available,
skip this test. Hence, this test is now skipped on linux-3.5.0 with
ext4 or tmpfs. The test runs (and passes) with at least btrfs, xfs,
or ocfs2.
* bootstrap.conf (gnulib_modules): Use the perl module.
|
|
|
|
|
| |
* bootstrap.conf (gnulib_modules): Remove stat-size.
* src/main.c: Don't include stat-size.h; no longer needed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
"make distcheck" would fail when, during a test build,
an attempt to overwrite the deliberately-write-protected
$(srcdir)/grep.pot file would fail.
* bootstrap.conf (bootstrap_epilogue): Don't let the existence of
a large sparse file in the build directory induce "make distcheck"
failure. The existence of a large sparse test file named 8T-or-so
would make po/Makefile.in.in's use of grep (to search for "GNU grep"
as an indication that this is a GNU package) exit 2 without generating
any output, which made the first xgettext use --package-name=grep,
while that same search for "GNU grep" would succeed when run
from a pristine from-tarball build, thus making the second
xgettext invocation use --package-name='GNU grep'.
That mismatch:
-"Project-Id-Version: grep 2.12.18-1080\n"
+"Project-Id-Version: GNU grep 2.12.18-1080\n"
led to the attempt by Makefile.in.in's grep.pot-update rule to
overwrite ../../grep.pot in the read-only po/ source directory.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* NEWS: Document this.
* doc/grep.texi (File and Directory Selection): Likewise.
* bootstrap.conf (gnulib_modules): Add stat-size.
* src/main.c: Include stat-size.h.
(usable_st_size): New function, mostly stolen from coreutils.
(fillbuf): Use it.
(file_is_binary): New function, which looks for holes too.
(grep): Use it.
* tests/Makefile.am (TESTS): Add big-hole.
* tests/big-hole: New file.
|
|
|
|
|
|
|
|
| |
* bootstrap.conf (gnulib_modules): Remove hard-locale.
* src/dfa.c (hard_LC_COLLATE): Remove.
(dfaparse): Do not initialize it.
(parse_bracket_exp): Always go through system regex matcher to find
single byte characters matching a range.
|
|
|
|
|
| |
* bootstrap.conf (avoided_gnulib_modules): Define.
(gnulib_tool_option_extras): Use it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* NEWS: Document this.
* bootstrap.conf (gnulib_modules): Add inttypes, xstrtoimax.
Remove xstrtoumax.
* src/main.c: Include <inttypes.h>, for INTMAX_MAX, PRIdMAX.
(context_length_arg, prtext, grepbuf, grep, grepfile)
(get_nondigit_option, main):
Use intmax_t, not int, for line counts.
(context_length_arg, main): Silently ceiling line counts
to maximum value, since there's no practical difference between
doing that and using infinite-precision arithmetic.
(out_before, out_after, pending): Now intmax_t, not int.
(max_count, outleft): Now intmax_t, not off_t.
(prepend_args, prepend_default_options, main):
Use size_t, not int, for sizes.
(prepend_default_options): Check for int and size_t overflow.
|
|
|
|
|
|
|
|
|
|
|
| |
* bootstrap: Update from gnulib.
* tests/init.sh: Update from gnulib.
* bootstrap.conf (bootstrap_epilogue): Remove now-unnecessary,
snippet that edited gnulib-tests/gnulib.mk.
(gnulib_tool_option_extras): Add both --symlink and
--makefile-name=gnulib.mk. Remove use of $bt.
* lib/Makefile.am: Initialize numerous automake variables so that
generated code in gnulib.mk may use += to append to them.
|
|
|
|
|
|
|
|
|
|
| |
* bootstrap.conf: Add isatty module.
* gnulib: Update to latest.
* lib/colorize.h: Remove argument from should_colorize.
* lib/ms/colorize.h: Likewise.
* lib/colorize-impl.c: Factor isatty call out of here...
* lib/ms/colorize-impl.c: ... and here...
* src/main.c: ... into here.
|
|
|
|
| |
Run "make update-copyright".
|
|
|
|
|
|
|
|
|
| |
* bootstrap.conf (gnulib_modules): Add iswctype and wcscoll.
* configure.ac: Remove explicit checks for those functions.
* src/mbsupport.h (MBS_SUPPORT): Define to 1 if not already defined.
Remove the conditional, now that we're guaranteed by gnulib to have
wcscoll and iswctype.
Suggested by Alan Hourihane in http://savannah.gnu.org/bugs/?34930
|
|
|
|
|
|
| |
* configure.ac: Remove AC_SYS_LARGEFILE, subsumed by ...
* bootstrap.conf (gnulib_modules): ...this. Use largefile module.
* gnulib: Update to latest.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This avoids a potential "infinite" disk-filling loop.
Reported in http://savannah.gnu.org/patch/?5316
and http://savannah.gnu.org/bugs/?17457.
* src/main.c: Include "quote.h".
(out_stat): New global.
(grepfile): Compare each regular file's dev/ino/etc.
with those from the file on stdout (if it too is regular).
(main): Set out_stat, if stdout is a regular file.
* src/system.h: Include "same-inode.h".
(same_file_attributes): Define. From diffutils.
(SAME_REGULAR_FILE): Define.
* bootstrap.conf (gnulib_modules): Use quote, not quotearg.
Use same-inode.
* NEWS (Bug fixes): Mention it.
|
|
|
|
|
| |
* bootstrap.conf: Remove now-unnecessary code to exclude
gettext/intl-related m4 tests.
|
|
|
|
|
| |
* bootstrap.conf (gnulib_modules): Drop strtoul, rename wctype to
wctype-h.
|
|
|
|
|
|
|
|
| |
* bootstrap.conf (gnulib_modules): Add readme-release.
(bootstrap_epilogue): Add the recommended perl one-liner.
* README-release: Remove file; it is now generated from gnulib.
* .gitignore: Add it.
* gnulib: Update submodule to latest.
|
|
|
|
| |
* bootstrap.conf (gnulib_modules): Remove now-obsolete "strtol".
|
|
|
|
| |
Run "make update-copyright", so "make syntax-check" works in 2011.
|