grep-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

grep ./ChangeLog tests/foad1.sh tests/fmbtest.s...


From: Charles Levert
Subject: grep ./ChangeLog tests/foad1.sh tests/fmbtest.s...
Date: Thu, 10 Nov 2005 14:57:58 -0500

CVSROOT:        /cvsroot/grep
Module name:    grep
Branch:         
Changes by:     Charles Levert <address@hidden> 05/11/10 19:57:54

Modified files:
        .              : ChangeLog 
        tests          : foad1.sh fmbtest.sh 
        src            : grep.h grep.c search.c 

Log message:
        The introduction of the --only-matching and --color GNU extensions
        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).

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/grep/grep/ChangeLog.diff?tr1=1.279&tr2=1.280&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/grep/grep/tests/foad1.sh.diff?tr1=1.13&tr2=1.14&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/grep/grep/tests/fmbtest.sh.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/grep/grep/src/grep.h.diff?tr1=1.12&tr2=1.13&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/grep/grep/src/grep.c.diff?tr1=1.116&tr2=1.117&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/grep/grep/src/search.c.diff?tr1=1.37&tr2=1.38&r1=text&r2=text





reply via email to

[Prev in Thread] Current Thread [Next in Thread]