| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
* bootstrap.conf (avoided_gnulib_modules): Restore those tests.
The failures I saw must have been due to a stale config.cache.
|
|
|
|
|
| |
* bootstrap.conf (avoided_gnulib_modules): Omit strtoll and strtoull
tests, because the edge-case 0[bx] tests fail on recent systems.
|
|
|
|
|
|
|
|
|
|
| |
The meaning of AC_SYS_LARGEFILE has changed to no longer even try
to use wider time_t if available. So use AC_SYS_YEAR2038 as well.
A more-aggressive change would be to use the next Autoconf’s
AC_SYS_YEAR2038_REQUIRED but at least let’s restore the grep 3.8
behavior.
* NEWS: Mention this.
* bootstrap.conf: Add year2038.
|
|
|
|
|
| |
* bootstrap.conf (buildreq): Remove rsync.
* README-prereq: Likewise.
|
| |
|
|
|
|
|
|
|
|
| |
Prefer the standard C23 ckd_* macros to Gnulib’s *_WRAPV macros.
* bootstrap.conf (gnulib_modules): Add stdckdint.
* src/grep.c, src/kwset.c, src/pcresearch.c:
Include stdckdint.h, and prefer ckd_* to *_WRAPV.
Include intprops.h only if needed.
|
|
|
|
|
|
| |
* bootstrap.conf (gnulib_modules): Add assert-h,
for static_assert.
* src/dfasearch.c (regex_compile): Prefer static_assert to verify.
|
|
|
|
|
| |
* bootstrap.conf (gnulib_modules): Remove alloca; we do not
use it directly.
|
|
|
|
| |
* bootstrap.conf (gnulib_modules): Remove iswctype, an unused and obsolete module.
|
|
|
|
|
|
|
| |
* bootstrap.conf (gnulib_modules): Remove fdl.
* doc/.gitignore: Do not list fdl.texi
* doc/fdl.texi: New file.
* cfg.mk (FILTER_LONG_LINES): Add doc/fdl.texi.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This improves runtime checking for integer overflow when compiling
with gcc -fsanitize=undefined and the like. It also avoids
the need for some integer casts, which can be error-prone.
* bootstrap.conf (gnulib_modules): Add idx.
* src/dfasearch.c (struct dfa_comp, kwsmusts):
(possible_backrefs_in_pattern, regex_compile, GEAcompile)
(EGexecute):
* src/grep.c (struct patloc, patlocs_allocated, patlocs_used)
(n_patterns, update_patterns, pattern_file_name, poison_len)
(asan_poison, fwrite_errno, compile_fp_t, execute_fp_t)
(buf_has_encoding_errors, buf_has_nulls, file_must_have_nulls)
(bufalloc, pagesize, all_zeros, fillbuf, nlscan)
(print_line_head, print_line_middle, print_line_tail, grepbuf)
(grep, contains_encoding_error, fgrep_icase_available)
(fgrep_icase_charlen, fgrep_to_grep_pattern, try_fgrep_pattern)
(main):
* src/kwsearch.c (struct kwsearch, Fcompile, Fexecute):
* src/kwset.c (struct trie, struct kwset, kwsalloc, kwsincr)
(kwswords, treefails, memchr_kwset, acexec_trans, kwsexec)
(treedelta, kwsprep, bm_delta2_search, bmexec_trans, bmexec)
(acexec):
* src/kwset.h (struct kwsmatch):
* src/pcresearch.c (Pcompile, Pexecute):
* src/search.h (mb_clen):
* src/searchutils.c (kwsinit, mb_goback, wordchars_count)
(wordchars_size, wordchar_next, wordchar_prev):
Prefer idx_t to size_t or ptrdiff_t for nonnegative sizes,
and prefer ptrdiff_t to size_t for sizes plus error values.
* src/grep.c (uword_size): New constant, used for signed
size calculations.
(totalnl, add_count, totalcc, print_offset, print_line_head, grep):
Prefer intmax_t to uintmax_t for wide integer calculations.
(fgrep_icase_charlen): Prefer ptrdiff_t to int for size offsets.
* src/grep.h: Include idx.h.
* src/search.h (imbrlen): New function, like mbrlen except
with idx_t and ptrdiff_t.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
| |
* bootstrap.conf (gnulib_modules): Add rawmemchr.
* src/dfasearch.c (GEAcompile, EGexecute):
* src/grep.c (update_patterns, prpending, prtext):
* src/kwsearch.c (Fcompile, Fexecute):
* src/pcresearch.c (Pcompile, Pexecute):
Simplify (and presumably speed up a little) by using rawmemchr
with a sentinel, instead of using memchr.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
* gnulib: Update submodule to latest.
* bootstrap.conf (gnulib_modules): Add explicit dependency on dirname-lgpl.
Before, we pulled this in via a dependency.
* bootstrap: Update from gnulib.
|
|
|
|
|
|
|
|
| |
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.
|