[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
grep ./ChangeLog src/grep.c
From: |
Charles Levert |
Subject: |
grep ./ChangeLog src/grep.c |
Date: |
Thu, 17 Nov 2005 18:13:12 -0500 |
CVSROOT: /cvsroot/grep
Module name: grep
Branch:
Changes by: Charles Levert <address@hidden> 05/11/17 23:13:12
Modified files:
. : ChangeLog
src : grep.c
Log message:
On 2005-06-21, many changes were made that affected --color,
--only-matching, and --invert-match. Some of them introduced a
misunderstanding between the concepts of matched/non-matched and
selected/rejected lines. Furthermore, a few bugs with -v sneaked
in stemming from this. This set of changes aims to rectify most
of this situation. Some GREP_COLORS capabilities are also added
as a result of the clarification. (Further issues with -v/-o/-C
feature interaction still remain to be sorted out.)
* src/grep.c: Rename/add global variables, macros, and capabilities:
SEP_CHAR_MATCH --> SEP_CHAR_SELECTED
SEP_CHAR_CONTEXT --> SEP_CHAR_REJECTED
SEP_STR_CHUNK --> SEP_STR_GROUP
grep_color --> selected_match_color + context_match_color
mlines_color --> selected_line_color
context_color --> context_line_color
"ml" --> "sl"
"mt" --> "mt" = "ms" + "mc"
--> "rv" (reverse "sl"/"cx" when -v)
* src/grep.c (color_cap_mt_fct, color_cap_rv_fct): New functions.
* src/grep.c (print_line_tail): Renamed color argument to line_color.
* src/grep.c (print_line_middle, prline): Revert part of the logic to
a pre-2005-06-21 one so that lines with matches have their matched
parts properly handled again ("m?" colors or --only-matching),
whether or not -v is specified. Whole line colors ("sl", "cx")
follow a selected / rejected(context) logic, as opposed to a
matched / non-matched one (unless "rv"). Matched text colors ("ms",
"mc") always follow a selected / rejected(context) logic,
regardless of "rv", because only matched lines use them anyway.
pr_line_middle() now takes additional line_color and match_color
arguments computed by prline() prior to calling that function.
The old logic was a buggy hybrid matched / rejected(context) one.
* src/grep.c (prpending, prtext, grepfile): Renamed macro invocations.
* src/grep.c (parse_grep_colors): Update top comment.
* src/grep.c (main): GREP_COLOR (singular) now sets both
selected_match_color and context_match_color.
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/grep/grep/ChangeLog.diff?tr1=1.285&tr2=1.286&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/grep/grep/src/grep.c.diff?tr1=1.118&tr2=1.119&r1=text&r2=text