| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
* src/pcresearch.c (WITHOUT_PCRE_NORETURN): Remove macro.
(Pexecute): Replace abort() call with code that does not trigger GCC
warnings.
|
|
|
|
|
|
|
|
|
|
|
| |
This appears to arise only on systems for which "char" is signed.
* src/dfa.c (FETCH_WC, FETCH): Produce an unsigned value, rather
than a sign-extended one. Fixes a bug on MS-Windows with compiling
patterns that include characters with the 8-th bit set.
(to_uchar): Define. From coreutils.
Reported by David Millis <tvtronix@yahoo.com>.
See http://thread.gmane.org/gmane.comp.gnu.grep.bugs/3893
* NEWS (Bug fixes): Mention it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/dfa.c (setbit_case_fold_c, parse_bracket_exp, lex):
(addtok_mb, dfaparse): Change each "MBS_SUPPORT && MB_CUR_MAX > 1"
test to just "MB_CUR_MAX > 1".
* src/dfasearch.c (kwsincr_case, EGexecute): Likewise.
* src/kwsearch.c (Fcompile, Fexecute): Likewise.
* src/searchutils.c (kwsinit): Likewise.
* src/dfa.c (parse_bracket_exp): Convert
"if (!MBS_SUPPORT || MB_CUR_MAX == 1)" to
"if (MB_CUR_MAX == 1)" and do this:
- assert(!MBS_SUPPORT || MB_CUR_MAX == 1);
+ assert(MB_CUR_MAX == 1);
|
|
|
|
|
|
|
|
| |
* src/dfa.c (dfainit): Set d->mb_cur_max unconditionally, now
that MB_CUR_MAX is always usable. With that, simplify all
"MBS_SUPPORT && d->mb_cur_max > 1" to simply "d->mb_cur_max > 1".
(dfastate, dfaexec, dfainit, dfafree): Simplify, removing each
now-unnecessary "MBS_SUPPORT &&".
|
|
|
|
|
|
| |
* src/dfa.c (setbit_case_fold_c): Remove "#if MBS_SUPPORT" in favor
of simple "if (MBS_SUPPORT ...".
(dfaexec, addtok): Likewise.
|
|
|
|
| |
* src/mbsupport.h [!MBS_SUPPORT] (MB_CUR_MAX): Define to 1.
|
|
|
|
|
|
|
| |
* src/dfa.c (add_utf8_anychar): Always compile this function,
but when MBS_SUPPORT is 0, give it an empty body.
(prepare_wc_buf): Likewise.
[! MBS_SUPPORT] (setbit_wc): Define to always abort.
|
|
|
|
|
|
| |
* src/dfa.c (dfaoptimize): Simplify.
(dfacomp): Remove now-redundant "if (MBS_SUPPORT)" guard,
since dfaoptimize does nothing if !MBS_SUPPORT.
|
|
|
|
|
| |
* src/dfa.c: Replace a few "#if MBS_SUPPORT" directives with
"if (MBS_SUPPORT)". Remove some altogether.
|
|
|
|
| |
* src/dfa.c (dfastate): Use regular "if", not #if MBS_SUPPORT.
|
|
|
|
| |
* src/dfa.c (dfastate): Use regular "if", not #if MBS_SUPPORT.
|
|
|
|
| |
* src/dfa.c (state_index): Use regular "if", not #if MBS_SUPPORT.
|
|
|
|
| |
* src/dfa.c (dfaparse): Use regular "if", not #if MBS_SUPPORT.'
|
|
|
|
| |
* src/dfa.c (copytoks): Use regular "if", not #if MBS_SUPPORT.'
|
|
|
|
| |
* src/dfa.c (lex): Use regular "if", not #if MBS_SUPPORT.'
|
|
|
|
| |
* src/dfa.c (parse_bracket_exp): Use regular "if", not #if MBS_SUPPORT.
|
|
|
|
| |
* src/dfa.c (parse_bracket_exp): Use regular "if", not #if MBS_SUPPORT.
|
|
|
|
| |
* src/dfa.c (parse_bracket_exp): Use regular "if", not #if MBS_SUPPORT.
|
|
|
|
| |
* src/dfa.c (dfaexec): Use regular "if", not #if MBS_SUPPORT.
|
|
|
|
|
| |
* src/dfa.c (dfaexec): Use regular "if", not #if MBS_SUPPORT.
Also add curly braces around multi-line if/else blocks.
|
|
|
|
| |
* src/dfa.c (free_mbdata): Remove the #if guard altogether.
|
|
|
|
|
| |
* src/dfa.c (dfaoptimize, dfacomp): Use regular "if",
not #if MBS_SUPPORT.
|
|
|
|
| |
* src/dfa.c (dfafree): Use regular "if", not #if MBS_SUPPORT.
|
|
|
|
| |
* src/dfa.c (parse_bracket_exp): Remove in-function #if MBS_SUPPORT.
|
|
|
|
| |
* src/search.h: Don't bother to #if-out declarations.
|
|
|
|
| |
* src/dfasearch.c (EGexecute): Remove in-function #if MBS_SUPPORT.
|
|
|
|
|
| |
* src/dfasearch.c (kwsincr_case): Remove in-function #if MBS_SUPPORT.
Move decl's down.
|
|
|
|
|
| |
* src/kwsearch.c (Fcompile, Fexecute): Remove in-function #if MBS_SUPPORT.
(Fcompile): Rearrange some declarations. No semantic change.
|
|
|
|
| |
* src/searchutils.c (kwsinit): Remove in-function #if MBS_SUPPORT.
|
|
|
|
| |
* src/dfa.c [DEBUG] (prtok): Remove now-useless #if-MBS_SUPPORT.
|
|
|
|
| |
* src/dfa.c (dfastate): Don't #ifdef-out "mbps" position_set member.
|
|
|
|
| |
* src/dfa.c (struct mb_char_classes): Don't #ifdef-out declarations.
|
|
|
|
|
|
| |
* src/pcresearch.c [!HAVE_LIBPCRE] (WITHOUT_PCRE_NORETURN): Define
to _Noreturn, not obsoleted-by-gnulib _GL_ATTRIBUTE_NORETURN.
Reported by Eric Blake.
|
|
|
|
| |
* 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]
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
and --enable-gcc-warnings.
* src/pcresearch.c (WITHOUT_PCRE_NORETURN): Define.
Remove the unreachable return statement.
Reported by Eric Blake.
|