| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
| |
* src/pcresearch.c [!HAVE_LIBPCRE] (WITHOUT_PCRE_NORETURN): Define
to _Noreturn, not obsoleted-by-gnulib _GL_ATTRIBUTE_NORETURN.
Reported by Eric Blake.
|
|
|
|
|
|
|
|
| |
* tests/init.cfg (skip_test_): Remove definition. Use the improved
skip_ function from init.sh, now that it has the same feature.
* tests/euc-mb: s/skip_test_/skip_/
* tests/sjis-mb: Likewise.
* tests/fmbtest: Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* tests/init.cfg (require_compiled_in_MB_support): New function.
* tests/char-class-multibyte: Use it here, since this test cannot
succeed without MBS support.
* tests/equiv-classes: Likewise.
* tests/euc-mb: Likewise.
* tests/fgrep-infloop: Likewise.
* tests/init.cfg: Likewise.
* tests/prefix-of-multibyte: Likewise.
* tests/turkish-I: Likewise.
* tests/sjis-mb: Likewise.
|
|
|
|
| |
* tests/fmbtest: Use skip_ and fail_ to give better diagnostics.
|
|
|
|
| |
* src/dfa.c (match_mb_charset, match_anychar): Improve comments.
|
| |
|
|
|
|
|
| |
* src/dfa.c (dfaexec): Reposition curly braces to match indentation style.
Remove useless comment.
|
|
|
|
| |
* src/dfa.c (dfaexec): Move decl of local down into scope where used.
|
|
|
|
|
|
|
|
| |
* src/main.c (usage): Use "file name", not "filename" in descriptions
of --with-filename (-H), --no-filename (-h) and --label=LABEL.
Suggested by Sequoia McDowell.
bug: requires ru_RU.KOI8-R". [bug introduced in grep-2.9]
|
|
|
|
|
|
| |
* tests/unibyte-bracket-expr: Remove debug artifact introduced
by 2011-06-02 commit de5f7000, "tests: exercise a uni-byte [...]
bug: requires ru_RU.KOI8-R". [bug introduced in grep-2.9]
|
|
|
|
|
|
| |
* configure.ac: Remove AC_SYS_LARGEFILE, subsumed by ...
* bootstrap.conf (gnulib_modules): ...this. Use largefile module.
* gnulib: Update to latest.
|
|
|
|
|
|
|
|
|
|
| |
* src/dfa.c (icatalloc): Clean up; use xrealloc in place of malloc
and realloc; remove conditionals that are unnecessary, now that
failed allocation results in exit.
(enlist): Use xrealloc in place of realloc; remove conditional.
(comsubs): Avoid leak upon failed enlist call.
(dfamust): Use xmalloc in place of malloc.
Remove conditionals, now that icpyalloc and icatalloc never return NULL.
|
|
|
|
| |
* src/main.c (main): Use x2nrealloc, not xrealloc
|
|
|
|
|
| |
* tests/Makefile.am (TESTS): Add it.
* tests/in-eq-out-infloop: Exercise the bug/fix.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
* doc/grep.in.1: Reword documentation of character classes.
|
|
|
|
| |
* src/dfa.c: Don't include "verify.h".
|
|
|
|
|
| |
* src/dfa.c (XNMALLOC, XCALLOC): Redefine without outer cast-to-(t *).
(CALLOC, MALLOC, REALLOC): Remove type "t" parameter and adjust callers.
|
|
|
|
|
|
|
|
| |
* src/dfa.c (REALLOC_IF_NECESSARY): Change meaning of 3rd param,
from "maximum index" to 1 greater than that: the required number
of *P-sized elements. Note that only some of the uses of
REALLOC_IF_NECESSARY needed to be adjusted, the others had already
required an extra element.
|
|
|
|
|
| |
* src/dfa.c (REALLOC_IF_NECESSARY): Rename nalloc and new_nalloc
to n_alloc and new_n_alloc.
|
|
|
|
|
| |
* src/dfa.c (REALLOC_IF_NECESSARY): Remove "t" (type) parameter.
Use (*p) instead. Adjust all callers.
|
|
|
|
|
| |
* src/dfa.c (REALLOC_IF_NECESSARY): Add curly braces; use TABs
to right-indent.
|
|
|
|
|
|
| |
* doc/grep.texi (Character classes): Mention explicitly when
examples refer to the C locale, explain better the general
meaning of character classes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
dfa's "insert" function was supposed to be maintaining the position
list sorted on *decreasing* index, but since the 2009-12-09 "Speed
up insert" commit, 62458291, it was using code that assumed the data
were sorted on *increasing* index. As such, sometimes it would no
longer merge constraints (not finding a match) and would append
entries that normally would have matched and been merged. Those
erroneous append operations resulted in the heap overrun fixed by
2011-06-17 commit 0b91d692 by doubling the array size.
* src/dfa.c (insert): Fix the comparison.
(dfaanalyze): Now that that's fixed, revert commit 0b91d692,
allocating space for only d->nleaves entries, not double that.
As far as I can tell, this change has no effect other than
decreased memory usage, although it may improve performance
slightly, since the resulting list of positions is half as long
as it used to be.
|
|
|
|
| |
* src/dfa.c (copy): Use memcpy.
|
|
|
|
| |
* src/dfa.c (add_utf8_anychar): Change memcpy to copyset.
|
|
|
|
| |
Fixes mmap-anon.m4 conflict with fn_grep, reported by Rainer Orth.
|
|
|
|
|
|
| |
* bootstrap: Update to latest, so it no longer inserts empty lines
in .gitignore files.
* .gitignore: Let bootstrap move "!..." lines to end of file.
|
|
|
|
|
|
| |
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
|
|
|
|
| |
* NEWS: Record release date.
|
|
|
|
|
|
|
| |
and --enable-gcc-warnings.
* src/pcresearch.c (WITHOUT_PCRE_NORETURN): Define.
Remove the unreachable return statement.
Reported by Eric Blake.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds a rule run at "make check" time to ensure that
test scripts are consistently executable.
This change is not required for "make check", but makes it easier
for people to run scripts manually, but that is discouraged because
doing so makes it easy to omit important variable settings that
are normally provided via TESTS_ENVIRONMENT.
This change also makes each of the existing TESTS executable.
* tests/Makefile.am (check_executable_TESTS): New rule.
(check): Depend on it.
* tests/{all_scripts}: chmod 755.
Prompted by a report from Eric Blake.
|
|
|
|
| |
* bootstrap: Update from gnulib.
|
|
|
|
|
| |
* po/POTFILES.in: Remove dfasearch.c, now that it no longer
contains a translatable diagnostic.
|
|
|
|
|
|
|
| |
* tests/include-exclude: Avoid false-positive failure due to
matching "a" in a directory on FreeBSD, when searching a directory
without "-r". Search for '^aaa$' rather than just 'a'.
Adjust test inputs and expected output files accordingly.
|
|
|
|
|
|
|
|
|
|
| |
* src/dfa.c (icatalloc): Change type of "old" parameter
from "char const *" to "char *".
Don't cast-away const on realloc argument.
Remove now-unnecessary const-discarding cast.
Don't (void)-cast strcpy result.
* src/dosbuf.c (undossify_input): Remove anachronistic
cast-to-"char *" of realloc argument.
|
|
|
|
|
|
|
|
|
|
| |
* src/dfa.c (enlist): Use xnrealloc, not realloc.
Also, remove unnecessary cast-to-(char *).
(dfamust): Use xnmalloc, not malloc. Before, this code would
return upon malloc failure (xnmalloc exits upon failure), but
later, via the *ALLOC macros, it could already exit, so this
new potential exit point is nothing new. The same applies
to enlist, since it is called only through dfamust.
|
|
|
|
|
|
|
| |
* tests/init.sh: Update from coreutils.
* tests/Makefile.am (TESTS_ENVIRONMENT): Remove shell_or_perl_
function. Instead, just use $(SHELL), since grep has no test
that starts with #!/usr/bin/perl.
|
| |
|
|
|
|
|
| |
* bootstrap.conf: Remove now-unnecessary code to exclude
gettext/intl-related m4 tests.
|
|
|
|
|
| |
* src/main.c (parse_grep_colors): Use xstrdup in place of xmalloc,
a useless test, strlen, and strcpy.
|
|
|
|
|
|
|
| |
* src/dfa.c (REALLOC_IF_NECESSARY, CALLOC, MALLOC, REALLOC):
Use functions from xalloc.h to avoid overflow.
* src/dfasearch.c (GEAcompile): Use xnrealloc rather than realloc.
* src/pcresearch.c (Pcompile): Use xnmalloc, not xmalloc.
|
| |
|
|
|
|
|
|
|
| |
* src/dfa.c (setbit_c, setbit_case_fold_c): Compare the btowc
return value against WEOF, not EOF. Suggested by Eli Zaretskii.
On a system like MinGW with unsigned wint_t, comparing a btowc
return value against EOF (-1) would always be false.
|
|
|
|
|
|
|
|
|
|
|
| |
* src/dfa.c (dfaanalyze): Allocate space for twice as many
positions as there are leaves. Before this change, for some
regular expressions, DFA analysis would have inserted far more
"positions" than dfa->nleaves (up to double).
Reported by Raymond Russell in http://savannah.gnu.org/bugs/?33547
* tests/dfa-heap-overrun: Trigger the overrun.
* tests/Makefile.am (TESTS): Add it.
* NEWS (Bug fixes): Mention it.
|
|
|
|
|
|
|
|
| |
I made changes that caused grep to segfault during "make check" --
as seen in dmesg output -- yet no test failed(!), and there was no
trace of the segfault in the logs.
* tests/sjis-mb (test_grep_reject): Ensure that output is empty.
Don't ignore test failure.
|
|
|
|
|
| |
* src/dfa.c (addtok): Compile characters to an alternation. Handle the
case when nothing else remains in the MBCSET.
|
|
|
|
|
| |
* src/dfa.c (parse_bracket_exp): Move optimization of MBCSET from here...
(addtok): ... to here.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This provides a better fix for the unibyte-bracket-expr and high-bit-range
testcases, and fixes the latent bug tested by bogus-wctob.
* src/dfa.c (setbit_case_fold): Remove, replace with...
(setbit_wc, setbit_c, setbit_case_fold_c): ... these.
(parse_bracket_exp): Use setbit_case_fold_c when iterating over
single-byte sequences. Use setbit_wc for multi-byte character sets,
and setbit_case_fold_c for single-byte character sets.
(lex): Use setbit_case_fold_c for single-byte character sets.
|
|
|
|
|
| |
* tests/bogus-wctob: New.
* Makefile.am (TESTS): Add it.
|