Parent Directory
|
Revision Log
| Links to HEAD: | (view) (download) (annotate) |
| Sticky Tag: |
(usage): one more tweak to the --help output.
punctuation in --help message
mention urls in help msg
* lib/savedir.c (isdir): New declaration.
* src/dfa.c (update_mb_len_index): Change argument type to
'char const *'.
(match_mb_charset): Cast argument to strncpy.
(dfaexec): Add pointer cast.
* src/grep.c (parse_grep_colors): Add braces for disambiguation.
* src/kwset.c: Include xalloc.h instead of declaring xmalloc manually.
* tests/foad1.sh: disable tests that fail under cs_CZ.UTF-8.
* tests/fmbtest.sh: likewise
* src/grep.c: Factor out copyright year in --version. Thanks to
Karl Berry for this.
* src/grep.c: Update copyright years
* src/grep.c: Update grep copyright year
* Re-commit changes of 2007-10-07
* configure.ac.in: update version to 2.6-dev
* src/grep.c: update --version message
Revert changes since grep-2.5.3 release to add a tag to CVS.
* 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
GPLv2 -> GPLv3
--exclude-dir
Remove bogus warning
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.
* src/grep.c (parse_grep_colors, main): Replace all uses of
fprintf(stderr, _("%s: foo\n"), program_name, ...) with
error(0, 0, _("foo"), ...) for uniformization and simplification
of warning messages that will be up for localization. (My bad.)
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).
* src/grep.c (main): Fix a subtle memory allocation bug introduced with the mb_icase_keys() function, which can call xrealloc() or free() on keys, by making sure keys is always dynamically allocated.
The following set of changes aims to make "egrep" and "fgrep" minimal executable programs for legacy applications, instead of shell scripts. This "fgrep" is much smaller than "grep". This set of changes appears more daunting than it really is. * src/egrep.c, src/fgrep.c, src/esearch.c, src/fsearch.c: New files that #define either EGREP_PROGRAM or FGREP_PROGRAM and #include the corresponding generic (i.e., non e or f specific) *.c file. * src/grepmat.c: Remove whole file. * src/Makefile.am: Remove no-dependencies from AUTOMAKE_OPTIONS. Add definitions to make "egrep" and "fgrep" specific standalone executable programs that only use the source files they need. Remove rules for "egrep" and "fgrep" shell scripts. * src/grep.h: #define GREP_PROGRAM if both EGREP_PROGRAM and FGREP_PROGRAM are #undef. Only declare matchers[] in this case along with the compile_fp_t and execute_fp_t function pointers typedefs, otherwise declare prototypes for straight compile() and execute() functions for the specialized "egrep" and "fgrep" programs. Remove the extern declaration for matcher. Define COMPILE_RET, COMPILE_ARGS, EXECUTE_RET, EXECUTE_ARGS, COMPILE_FCT, and EXECUTE_FCT helper preprocessor macros. * src/grep.c (short_options, long_options, usage, main): Only support -G, -E, -F, -P, and -X for GREP_PROGRAM, but not for EGREP_PROGRAM or FGREP_PROGRAM. Customize usage messages. * src/grep.c (set_limits): New function with unchanged code, called from main(), because it shouldn't be in install_matcher() since it was already matcher-independent. * src/grep.c (matcher): Add as static, only for GREP_PROGRAM. * src/grep.c (setmatcher, install_matcher): Only for GREP_PROGRAM. * src/grep.c (main): Remove any tweaking and dependence on argv[0]. * src/grep.c (print_line_middle, prpending, grepbuf, main): Call compile() and execute() directly, not through a function pointer dereferencing notation, so that it works with both straight functions (in EGREP_PROGRAM and FGREP_PROGRAM) and function pointers (in GREP_PROGRAM). * src/search.c (<regex.h>, "dfa.h", dfa, pattern0, patterns, pcount, dfaerror, kwset_exact_matches, kwsmusts): Only include/declare/define if not FGREP_PROGRAM. * src/search.c: Remove function prototypes for all functions that are not used before their definition, since this is just a hassle now with their varying names and conditional definition. * src/search.c (GEAcompile): Rename from Ecompile(). Add new syntax_bits argument/variable. Use as compile() for EGREP_PROGRAM. Put in the needed RE_ICASE fix, albeit commented-out for now. Make sure to free() modified word/line pattern after use, if any. * src/search.c (Gcompile): Merge with GEAcompile() then remove. * src/search.c (Gcompile, Acompile, Ecompile): New small functions that call GEAcompile(), now that matcher is not an extern variable. * src/search.c (GEAcompile, Gcompile, Acompile, Ecompile, Fcompile, Pcompile, EGexecute, Fexecute, Pexecute, matchers): Only define when needed according to *GREP_PROGRAM, and rename to just compile() and execute() when appropriate. * grep/bootstrap/Makefile.try: Similar changes.
* src/grep.c (mb_icase_keys): New function to properly lowercase keys if match_icase. The problem was that some multi-octet characters can get longer or shorter upon this conversion, so that it cannot just naively be done in place on the same memory buffer. * src/grep.c (main): Call mb_icase_keys (and remove in-line code).
* src/grep.c (print_line_middle): In case of an empty match, 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.
* src/grep.c: Remove all xm capability code.
* src/grep.c (color_cap_ne_fct, color_cap_xm_fct, print_line_middle, print_line_tail): Make these four functions static.
* src/grep.c (prline): Simplifying rewrite using print_line_middle() and print_line_tail(). No longer attempts to find matches to colorize in context lines, thus avoiding costly calls to (*execute)(), since we know by then that they can't contain any by definition. There are no longer four different code paths whether -o and -i are each specified or not; they have been unified into one, which should help avoid bugs similar to previous ones due to not updating all code paths in a synchronized fashion. The -i code has been explicitly marked since it doesn't belong there and should be removed as soon as other -i code elsewhere is fixed. The remaining GREP_COLORS functionality is implemented. Savannah patch #3771 and patch #3644, heavily reworked.
* src/grep.c (print_line_middle, print_line_tail): New functions, unused for now, intended to allow a simplifying rewrite of prline(). Adding them first will make for cleaner CVS patches.
* src/grep.c (print_offset): Renamed print_offset_sep() to better represent its new functionality; new calling convention. * src/grep.c (print_offset, print_line_head): Use and implement missing parts of the GREP_COLORS and -T/--initial-tab frameworks.
* src/grep.c: The new -T/--initial-tab framework, only partially used at this point to make for a simpler initial patch in CVS. A subset of patch #3644 on Savannah. The option name/calling convention is the same as for GNU diff. * doc/grep.texi, doc/grep.1: Document -T/--initial-tab.
* src/grep.c: The new GREP_COLORS (plural) framework, only partially used at this point to make for a simpler initial patch in CVS. A subset of patch #3644 on Savannah. * src/grep.c (color_cap_ne_fct, color_cap_xm_fct, print_filename, print_sep, parse_grep_colors): New functions. * src/grep.c (prtext, grepfile, main): Existing functions modified to use the new framework. * doc/grep.texi, doc/grep.1: Document GREP_COLORS.
* src/grep.c (SEP_CHAR_MATCH, SEP_CHAR_CONTEXT, SEP_STR_CHUNK): New macros for ':', '-', and "--". Used throughout the file. Will be used even more in upcoming updates, so good to have now.
* tests/foad1.sh: Add tests combining -o, -n/-b/-H, and -i, 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.
* src/grep.c (main): Add a test to check if -o/--only-matching and context lines are both specified and if so, set both context specifications (before and after) to zero then print an explicit warning to stderr explaining what was done and why (as opposed to drastically aborting the process in error). Patch #3768. Other code needs this zero setting to work correctly without having to repeatedly test for this conflictual condition.
* src/grep.c (nlscan): Make this function more robust by removing the undocumented assumption that its "lim" argument points right after a line boundary. This will be used later to fix --byte-offset's broken behavior. Patch #3769.
* src/grep.c: Explain the context and logic for choosing default --color screen attributes (SGR parameters).
* src/grep.c: Extensively document the SGR/EL-to-Right issue.
Fix bug #11022 (Line wrapping causes GREP_COLOR background 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.
Update FSF's civic address, zip code, and citizen relocation code.
src/grep.c: Fix typo in prline()'s --only-matching --ignore-case code path; this fixes bug #9768 and passes one more test in tests/foad1.sh. This whole code path should be removed in the future, when other --ignore-case issues are dealt with.
Patch #3840 ("grep -m1 -A99" seg-fault); add tests for it.
Fix a seg-fault in "-o -i": patch #1939.
src/grep.c (get_nondigit_option): Don't give up too early.
document that -X is undocumented
Fix multibyte support detection in configure.
small changes from gawk
i18n patch by Isamu Hasegawa from IBM Japan
more phrasing fixes
Minor fixes of phrasing.
fix docs, mainly about --include and --exclude
fix details in strings
use PACKAGE_STRING
fix --devices=skip
Use PACKAGE_BUGREPORT.
bug report address change
- remove any references to bero@redhat.com - Fix -i -o combination
Fix another hang
Fix hang on 'grep --color "" anything'
Fix https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=61705
Add fix for -i --color
Prepare for release
Fix typo
--label stuff
Reduce bloat
Add -o option
Add vim modelines
- Fix pcre detection
- Add --color={always,never,tty} argument
- Add --devices (analogous to --directories)
- Don't enable blinking by default
- Document changes
2001-07-31 Andreas Schwab <schwab@suse.de> * src/grep.c: Fix all uses of error to pass a proper format string.
* grep/src/grep.c (usage): Typos corrected. Patches from Santiago Vila. 2001-07-29 Alain Magloire David Clissold, wrote: a small bug in the GNU grep 2.4.2, which may have gone unnoticed because it only causes a failure if building on a system with large files enabled (e.g. an "off_t" is a "long long" rather than a "long"). savedir() takes on off_t argument, but in grepdir() the parameter is cast to an (unsigned). Well, if an off_t is larger than an int, the value gets truncated. This would not normally have an effect on a little-endian platform (unless the file is >2GB), but on a big-endian system it will always fail. The external effect is that "grep -r foo dir_name" fails with ENOMEM (from malloc() within savedir()). * grep/src/grep.c (grepdir): Remove the (unsigned) cast when calling savedir().
Patch from Paul to correct I/O buffer.
Patch from Paul.
error() in format.
Copyright updated.
much of the supporting files moved to lib
Isamu changes in the dfa to support ANYCHAR (.).
add option --exclude-from, use tar exclude code
New option back-references are local, beefup manual.
new options --include --exclude.
.
hilight.
NT fix.
Port to MING32
improve performance.
byte offset.
-x bug corrected.
Exit status fix.
CRLF handling.
Consitent use of -C
Remove sentinel code.
Patch provided by Paul Eggert.
.
configure.in ChangeLog NEWS src/search.c src/grep.c doc/grep.1 doc/grep.texi support for -P(--pcre) Perl Compatible Regular Expression. support for -m --max-count.
ChangeLog configure.in doc/grep.1 doc/grep.texi src/dfa.c src/getpagesize.h src/grep.c src/kwset.c src/search.c src/system.h src/vms_fab.c src/vms_fab.h vms/make.com more support for VMS.
ChangeLog THANKS configure.in src/grep.c nit by Akim.
NEWS doc/grep.texi src/grep.c Changes provided By P.E to add a NL if the line is missing one.
ChangeLog NEWS doc/grep.1 doc/grep.texi src/grep.c Changes propose by P.E.
ChangeLog THANKS src/Makefile.am src/alloca.c src/dfa.c src/dosbuf.c src/getopt.c src/getopt.h src/getopt1.c src/getpagesize.h src/grep.c src/kwset.c src/memchr.c src/obstack.c src/obstack.h src/regex.c src/regex.h src/savedir.c src/savedir.h src/search.c src/stpcpy.c src/vms_fab.c Changes by P. E. to convert to ANSI C
ChangeLog NEWS THANKS doc/grep.1 doc/grep.texi src/grep.c src/system.h Support for general option --binary-file from David O'Brien.
mispelled in usage mispelled in usage
commit some changes provided by Paul commit some changes provided by Paul commit some changes provided by Paul
dont show non-binary files for -A/-B/-C
. patch for PE po updated
new set o patches from Paul new set o patches from Paul new set o patches from Paul
make egrep == grep -E. Bugfixes Accept a patch from Paul to make egrep == grep -E.
changes from Paul. changes from Paul.
update form Paul on his previous patch. update form Paul on his previous patch.
update to 2.3f new scheme by Paul Eggert for buffer allocation.
. fix typo in vms_fab.h .
change by Paul Eggert. change by Paul Eggert. change by Paul Eggert.
. . .
add GREP_OPTIONS. add GREP_OPTIONS. add GREP_OPTIONS.
some test commented out changes ?
change by Elie. use default_matcher for Version display.
typo.
update for 2.3a add comment for -C NUM. Restrict use of -E -F -G to grep only.
updates. updates from Eli. Few typo fixed. use DJ_GPP instead of DJGPP prototype undossify_input.
updates. minor changes to the name of the macros move #include dosbuf.c further down
Patch from Paul eggert for recursive. Patch from Volker in.
typo corrected. typo corrected.
had tst for setmode and HAVE_SETMODE and HAVE_DOS_FILENAME compatiblity patch from Paul.
add entry from Eli for grep.texi mods Patch form Eli for grep.texi typo infalid --> invalid
Update from Paul, dfainit() was call in search.c and also in dfacomp remove the search call. grep.c file was freed twice. Update from Paul, dfainit() was call in search.c and also in dfacomp remove the search call. grep.c file was freed twice.
Changes from Eli. Changes from Eli. Changes from Eli.
Entry form Paul. Use the attribute keyword from gcc to eliminate warnings.
Remove memory leak with valloced buffers, by invoking malloc instead. Remove memory leak with valloced buffers, by invoking malloc instead.
changes by paul to replace matcher=MATCHER scheme.
Changes from P. E. for the recurse behaviour.
. . corrected un bug I set the matcher to early
update use our own instead of default. now don't rely on matcher = argv[0] set explicitly at compilation.
added changes send by Miles Bader to make -C takes an argument.
put the wrong patch for wildcard under vms put the wrong patch for wildcard
the patch did not apply well (Paul recurse) do the change by hand.
support for -r --recuse courtesy of Paul Eggert.
changes from paul Changes from paul to support OS that doesn't expand wildcard from the shell
we now support skipping dir courtesy of Pau Eggert Support for -d -a courtesy of Paul Eggert.
from grep 2.2
Initial revision
This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, select a symbolic revision name using the selection box, or choose 'Use Text Field' and enter a numeric revision.
| savannah-hackers-public@gnu.org | ViewVC Help |
| Powered by ViewVC 1.1.26 |