| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
* autogen.sh: Remove what is useless with git.
|
| |
|
| |
|
|
|
|
|
|
|
| |
* tests/fmbtest.sh: likewise
* tests/foad1.sh: disable tests that fail under cs_CZ.UTF-8.
* tests/fmbtest.sh: likewise
|
|
|
|
|
|
|
|
|
|
|
|
| |
should be uncommented after the 2.5.4 release.
* tests/yesno.sh: Likewise.
* doc/grep.1: Update description of -e PATTERN; from Benno Schulenberg
* doc/grep.texi: Likewise.
* tests/foad1.h: Comment out cases that are known to fail. These
* tests/yesno.sh: Likewise.
* doc/grep.1: Update description of -e PATTERN; from Benno Schulenberg
* doc/grep.texi: Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* configure.ac.in: update version to 2.6-dev
* src/grep.c: update --version message
* configure.ac.in: update version to 2.6-dev
* src/grep.c: update --version message
* src/grep.c: When -h and -H are combined, use the last specified,
Bug #15620, Patch #4866
* tests/foad1.sh: add tests for -h and -H
* ChangeLog: Add a copyright notice (years taken from commit logs),
add a license notice (taken from gnulib ChangeLog)
* TODO: update the link to a list of other grep implementations
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Bug #15620, Patch #4866
* tests/foad1.sh: add tests for -h and -H
* ChangeLog: Add a copyright notice (years taken from commit logs),
add a license notice (taken from gnulib ChangeLog)
* TODO: update the link to a list of other grep implementations
* src/grep.c: When -h and -H are combined, use the last specified,
Bug #15620, Patch #4866
* tests/foad1.sh: add tests for -h and -H
* ChangeLog: Add a copyright notice (years taken from commit logs),
add a license notice (taken from gnulib ChangeLog)
* TODO: update the link to a list of other grep implementations
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
set it without modifying the script; the usual caller (Makefile)
still leaves it untouched (usually unset, so it's off by default).
Modify "-m1 -A99 '^...$'" tests that failed so that their
expectation now corresponds to the output currently produced
by grep. Those tests used to expect that two selected (or
selectable) lines be output, even with -m1. Nothing was
modified with other similar tests that output _context_ lines
after one selected line has been output with -m1; they used to
and still succeed. Although tests/yesno.sh now provides a more
comprehensive framework for testing -m/-C feature interaction,
it doesn't exercise mixing them with anchors so the whole
relevant tests/foad1.sh test group is kept, notably to check
that grep doesn't crash when it is run.
|
|
|
|
|
|
|
|
| |
of -C, -v, -o, and -m. This reveals bugs, including some I
introduced on 2005-06-21, but also others.
* tests/Makefile.am (TESTS): Add yesno.sh.
* tests/Makefile.am (CLEANFILES): Add cspatfile and csinput, as
created by fmbtest.sh. Add yesno.txt, as created by yesno.sh.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
to grep added the requirement that each execute() implementation
not only be able to identify matching lines as a whole, but also
individual "exact" matches within a line known to be matching,
from leftmost to rightmost match, when the output from matching
lines is actually produced. The interface and implementations
of execute() were not up to it. This set of changes aims to
rectify that situation. Previously failing tests relative to
left anchors (^ and \<) and -w should now pass. This fixes
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=11579>,
<http://savannah.gnu.org/patch/?func=detailitem&item_id=1834>,
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=8243>,
and possibly part of other, bigger, pending patches. The problem
was also compounded by the POSIX requirement to support a pattern
list instead of just an individual pattern (for -G and -E as well).
* tests/foad1.sh: Test for increasing/decreasing-length word
matches, given pattern order, and leftmost/longest match.
* tests/fmbtest.sh: Modify test #6 according to new expectations.
Better document what tests #6 and #7 are actually for. Eliminate
test #5 in favor of bringing tests #6 and #7 within the F G E loop.
* src/grep.h (EXECUTE_ARGS): Change last argument from "int exact"
to "char const *start_ptr". Testing for "start_ptr" being non-NULL
retains the same semantics as testing for "exact" being non-zero.
* src/grep.c (print_line_middle): Call execute() with whole
buffer to work on, but using current position as start_ptr.
* src/grep.c (prpending, grepbuf): Call execute() with NULL
as start_ptr.
* src/search.c (EGexecute, Fexecute, Pexecute): When start_ptr is
non-NULL, return first match from it as an offset relative to buf.
* src/search.c (EGexecute): Consider all patterns if many and,
for an exact match, return the best one (leftmost, then longest).
Don't explore worst solutions, of course (branch and bound).
|
|
|
|
|
| |
mode because it relies on a different code path that deserves
the same kind of testing.
|
|
|
|
|
|
|
|
|
|
| |
make minimal progress and continue instead of aborting process
of the remainder of the line, in case there's still an upcoming
non-empty match.
* tests/foad1.sh: Add two tests for this.
* doc/grep.texi, doc/grep.1: Document this behavior, since
--only-matching and --color are GNU extensions which are
otherwise unspecified by POSIX or other standards.
|
|
|
|
|
| |
* tests/pcre.sh: New file. Add test 1.
* tests/Makefile.am: Add pcre.sh to TESTS.
|
|
|
|
|
|
|
|
|
|
| |
grep/tests/bre.sh, grep/tests/empty.sh, grep/tests/ere.sh,
grep/tests/file.sh, grep/tests/fmbtest.sh, grep/tests/foad1.sh,
grep/tests/khadafy.sh, grep/tests/options.sh,
grep/tests/spencer1.sh, grep/tests/spencer2.sh,
grep/tests/status.sh, grep/tests/warning.sh: As per autoconf's
"Portable Shell Programming" guidelines, replace all instances
of "#!/bin/sh" by "#! /bin/sh" (notice the space).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
since there are separate code paths for -i. Add tests combining
-o, -n/-b/-H, and -3, since any context line specification
should be ignored when combined with -o.
* src/grep.c (print_line_head): New function, culled off the
top content of prline(). Adds a guard against "lastnl" having
already reached "lim", which can happen when if the function
is called more than once per line.
* src/grep.c (prline): Now calls print_line_head(), not only at
the beginning to replace the moved code when -o is not
specified, but also for each match when -o is specified (two
code paths with this). Patch #3770, more or less. This makes
all tests combining -o and -n/-b/-H pass, which they didn't
before. Fixes bug #12727.
|
|
|
|
|
|
| |
must work under posix mode. That means not using assignment
statements right before a function call (LC_ALL=... grep_test,
in this case), because it won't do the expected thing.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
color to "smear") by outputting a "clear to end of line"
control sequence after each SGR (Select Graphic Rendition)
control sequence (START and END). This also avoid similar
problems with HT (tab) characters.
* src/grep.c (SGR_START, SGR_END, PR_SGR_FMT, PR_SGR_FMT_IF,
PR_SGR_START, PR_SGR_END, PR_SGR_START_IF, PR_SGR_END_IF):
New macros.
* src/grep.c (prline): Use the new macros.
* tests/fmbtest.sh, tests/foad1.sh: Adjust the regression tests
to expect the new control sequences.
|
|
|
|
| |
Display LC_ALL when its value is special. Patch #3962.
|
|
|
|
|
| |
* src/dfa.c: Fix a DFA bug whereby a bracket "[" was matched by the
pattern "[[:alpha:]]" in UTF-8 locales. Patch #3800, by Tim Waugh.
|
| |
|
|
|
|
|
|
|
|
| |
Add more tests, some initially failing.
* tests/fmbtest.sh: New file of tests for "grep -i" with multi-byte
chars, by Jakub Jelinek, from patch #3808: Red Hat's "tests" patch.
Initially, test #4 fails (in all three modes).
* tests/Makefile.am: Include the new tests file "fmbtest.sh".
|
|
|
|
|
|
|
|
|
| |
Fix a bug reported by Elliott Hughes in patch #1834 whereby "grep -Fw"
would miss matches after a non-word occurrence of the pattern. Fix by
Gordon Lack; tests based on reproduction recipes by Gordon Lack.
* src/search.c (Fexecute): Fix the "match_words" case.
argument is optional. Add a regression test and a test for
a similar case that other proposed patches have got wrong.
|
|
|
|
|
|
|
| |
* src/grep.c: Fix off-by-one error in prpending().
Patch #3840 by Claudio Fontana.
* tests/foad1.sh: Add tests by Pavol Gono for patch #3840.
Some of them still fail, but no longer seg-fault due to that bug.
|
| |
|
|
|
|
| |
* tests/Makefile.am: Include the new tests file 'grep-o.sh'.
|
| |
|
|
|
|
| |
* tests/backref.sh: Fix trivial typos.
|
|
|
|
|
| |
* tests/status.sh: Added two tests--option `-s' should have no
influence on the exit status.
|
|
|
|
|
|
|
|
|
|
| |
* ./cvsignore: Amended several .cvsignore files and
removed *.gmo, acinclude.m4 and stamp-h.in from the root one.
* m4/init.m4: Nuked, it was breaking current automake.
* m4/Makefile.m4: Removed init.m4.
* autogen.m4: Drop support for legacy autoconf; tell whether the
auto tools exited successfully or not; fix the permissions of
tests/*.sh--CVS doesn't provide a way to fix it.
|
|
|
|
|
|
|
|
|
| |
* tests/spencer1.awk: Use only lines with 3 fields.
* tests/spencer1.tests: Disable #55 for now.
* tests/ere.tests, tests/bre.tests: Add "TO CORRECT" to disabled
tests which had empty $4.
* tests/backref.sh: Modify #2 so that current glibc regex can
handle it in finite time.
|
|
|
|
|
|
|
|
| |
Change bug-gnu-utils address to bug-grep, on many places; there
is no need to have the word ``grep'' in subject then.
Thanks to Tony Abou-Assaleh and Benno Schulenberg for pointing
out this.
* 2.5.1 Release.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
* src/Makefile.am, po/Makefile.in.in: Support DESTDIR properly
* tests/bre.tests: Add fix from
Peter Breitenlohner <peb@mppmu.mpg.de>
|
|
|
|
|
| |
* src/grep.c: Add --only-matching (-o) switch (see NEWS)
* doc/grep.texi, doc/grep.1, NEWS: Document changes
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Only the Regex patterns should be split in an array, patterns[].
The dfa and KWset compiled patterns should remain global and the
patterns compiled all at once.
* src/search.c : include "error.h" and "xalloc.h" to get prototyping
of x*alloc() and error().
(kwsinit) : Reverse to previous behaviour and takes no argument.
(kwsmusts) : Likewised.
(Gcompile) : For the regex pattern, split them and each pattern
is put in different compiled structure patterns[]. The patterns
are given to dfacomp() and kwsmusts() as is.
(Ecompile) : Likewised.
(Fcompile) : Reverse to the old behaviour of compiling the enire
patterns in one shot.
(EGexecute) : If falling to GNU regex for the matching, loop in the
array of compile patterns[] to find a match.
(error) : Many error () were call with arguments in the wrong order.
* tests/file.sh : Simple test to check for pattern in files.
Reaction to bug report fired by Greg Louis <glouis@dynamicro.on.ca>
In multibyte environments, handle multibyte characters as single
characters in bracket expressions.
* src/dfa.h (mb_char_classes) : new structure.
(mbcsets) : new variable.
(nmbcsets) : new variable.
(mbcsets_alloc) : new variable.
* src/dfa.c (prtok) : handle MBCSET.
(fetch_wc) : new function to fetch a wide character.
(parse_bracket_exp_mb) : new function to handle multibyte character
in lex().
(lex) : invoke parse_bracket_exp_mb() for multibyte bracket expression.
(atom) : handle MBCSET.
(epsclosure) : likewise.
(dfaanalyze) : likewise.
(dfastate) : likewise.
(match_mb_charset) : new function to judge whether a bracket match
with a multibyte character.
(check_matching_with_multibyte_ops) : handle MBCSET.
(dfainit) : initialize new variables.
(dfafree) : free new variables.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* doc/grep.texi : Document the new options and the new behaviour
back-references are local. Use excerpt from Karl Berry regex
texinfo.
* bootstrap/Makefile.try : Added xstrtoumax.o xstrtoul.o hard-local.o
From Guglielmo 'bond' Bondioni :
The bug was that using a multi line file that contained REs (one per
line), backreferences in the REs were considered global (to the file)
and not local (to the line).
That is, \1 in line n refers to the first \(.\) in the whole file,
rather than in the line itself.
From Tapani Tarvainen :
# Re: grep -e '\(a\)\1' -e '\(b\)\1'
That's not the way it should work: multiple -e arguments
should be treated as independent patterns and back references
should not refer to previous ones.
From Paul Eggert :
GNU grep currently does not issue
diagnostics for the following two cases, both of which are erroneous:
grep -e '[' -e ']'
grep '[
]'
POSIX requires a diagnostic in both cases because '[' is not a valid
regular expression.
To overcome those problems, grep no longer pass the concatenate
patterns to GNU regex but rather compile each patterns separately
and keep the result in an array.
* src/search.c (patterns) : New global variable; a structure array
holding the compiled patterns.
Declare function prototypes to minimize error.
(dfa, kswset, regexbuf, regs) : Removed, no longer static globals, but
rather fields in patterns[] structure per motif.
(Fcompile) : Alloc an entry in patterns[] to hold the regex.
(Ecompile) : Alloc an entry per motif in the patterns[] array.
(Gcompile) : Likewise.
(EGexecute) : Loop through of array of patterns[] for a match.
From Bernd Strieder :
# tail -f logfile | grep important | do_something_urgent
# tail -f logfile | grep important | do_something_taking_very_long
If grep does full buffering in these cases then the urgent operation
does not happen as it should in the first case, and in the second case
time is lost due to waiting for the buffer to be filled.
This is clearly spoken not grep's fault in the first place, but libc's.
There is a heuristic in libc that make a stream line-buffered only if a
terminal is on the other end. This doesn't take care of the cases where
this connection is somehow indirect.
* src/grep.c (line_buffered) : new option variable.
(prline) : if line_buffered is set fflush() is call.
(usage) : line_buffered new option.
Input from Paul Eggert, doing setvbuf() may not be portable
and breaks grep -z.
This patch prevent kwset_matcher from following problems.
For example, in SJIS encoding, one character has the codepoint 0x895c.
So the second byte of the character can match with '\' incorrectly.
And in eucJP encoding, there are the characters whose codepoints are
0xa5b9, 0xa5c8. On the other hand, there is one character whose
codepoint is 0xb9a5. So 0xb9a5 can match with 2nd byte of 0xa5b9
and 1st byte of 0xa5c8.
(EGexecute) : call check_multibyte_string when kwset is set.
(Fexecute) : call to check_multibyte_string.
(MB_CUR_MAX) : new macro.
|
|
|
|
|
| |
* tests/Makefile.am (TESTS_ENVIRONMENT): Add LC_ALL=C, since
some of the tests assume the C locale.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
POSIX.2 conformance fixes: grep -q now exits with status zero
if an input line is selected, even if an error also occurs.
grep -s no longer affects exit status.
* src/grep.c (suppress_errors): Move definition earlier so
that suppressible_error can use it.
(suppressible_error): New function.
(exit_on_match): New var.
(grepbuf): If exit_on_match is nonzero, exit with status zero
immediately.
(grep, grepfile, grepdir): Invoke suppressible_error.
(main): -q sets exit_on_match.
* doc/grep.1, doc/grep.texi, NEWS:
Document -q's behavior as required by POSIX.2.
* tests/status.sh:
Test for -q and -s behavior as conforming to POSIX.2.
|
|
|
|
|
| |
* tests/Makefile.am (TESTS_ENVIRONMENT):
Set GREP_OPTIONS to the empty string.
|
|
|
|
| |
* tests/status.sh: Fix typo: test -b -> test -r.
|