| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
disable-perl-regexp is needed as pcre is available on the
host system but will not be available on /tools
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
* doc/grep.texi (Top, Fundamental Structure, Usage):
Explain how grep deals with the empty pattern.
Problem spotted by Bernhard Voelker in
<http://lists.gnu.org/archive/html/bug-grep/2012-01/msg00050.html>.
|
|
|
|
|
|
|
|
|
| |
* NEWS: Document this.
* doc/grep.texi (Environment Variables, grep Programs): Likewise.
* src/main.c (usage): Likewise.
(main): Implement this.
(prepend_default_options): Return a count of prepended options.
* tests/r-dot: Test the above.
|
|
|
|
| |
* tests/ignore-mmap: Separate stdout and stderr; test both.
|
|
|
|
|
|
|
|
| |
* src/main.c (main): Deprecate the --mmap option: issue a warning
when it is used.
(usage): Change description.
* doc/grep.texi (Other Options): Document the new behavior.
* NEWS (Changes in behavior): Mention it.
|
|
|
|
| |
* src/dfa.c (dfastate): Fix comment for newline.
|
|
|
|
| |
* src/dfa.c (dfaanalyze): Fix reference to nalloc.
|
|
|
|
|
|
| |
* src/dfa.c (insert, copy, merge): Resize arrays here.
(dfaanalyze): Do not track number of allocated elements here.
(dfastate): Allocate mbps with only one element.
|
|
|
|
|
|
| |
* src/dfa.c (REALLOC_IF_NECESSARY): Disable assertion, to avoid
warnings from -Wtype-limits.
(position_set): Change nelem to a size_t.
|
|
|
|
|
|
| |
* src/dfa.c (position_set): Add alloc.
(alloc_position_set): Initialize it.
(dfaanalyze): Use it instead of the nalloc array or nelem.
|
|
|
|
|
| |
* src/dfa.c (transit_state): transit_state_consume_1char will clear follows,
do not do this ourselves.
|
|
|
|
| |
* src/dfa.c (alloc_position_set): New function, use it throughout.
|
|
|
|
|
|
| |
* src/dfa.c (leaf_set): New.
(dfastate): Use the smaller type, leaf_set, for grps. Its prior type
contained an unused constraint field.
|
|
|
|
| |
src/dfa.c (dfastate, enlist, dfamust): Use MALLOC and REALLOC.
|
|
|
|
| |
* src/dfa.c (dfastate): Remove unnecessary braces.
|
|
|
|
|
| |
* src/dfa.c (parse_bracket_exp): Do not MALLOC mbcset parts the first time
they are encountered. Initialize chars_al correctly.
|
|
|
|
|
| |
* lib/colorize-posix.c: Disable -Wsuggest-attribute=const, to avoid
warning about this empty init_colorize function.
|
|
|
|
|
|
|
|
|
|
| |
* configure.ac: Create lib/colorize.c as a symbolic link.
* lib/colorize-posix.c: New name of lib/colorize-impl.c.
* lib/colorize-w32.c: New name of lib/ms/colorize-impl.c.
* lib/colorize.c: Delete.
* lib/Makefile.am (EXTRA_DIST): Adjust.
* .gitignore: Adjust.
* cfg.mk: Adjust syntax-check exclusions.
|
|
|
|
|
|
|
|
| |
* lib/Makefile.am (EXTRA_DIST): Adjust.
* lib/colorize.h: Remove inline functions.
* lib/colorize-impl.c: Move them here as functions.
* lib/ms/colorize.h: Remove.
* src/Makefile.am (DEFAULT_HEADERS): Remove.
|
|
|
|
|
|
|
|
|
|
| |
* bootstrap.conf: Add isatty module.
* gnulib: Update to latest.
* lib/colorize.h: Remove argument from should_colorize.
* lib/ms/colorize.h: Likewise.
* lib/colorize-impl.c: Factor isatty call out of here...
* lib/ms/colorize-impl.c: ... and here...
* src/main.c: ... into here.
|
|
|
|
|
| |
* tests/r-dot: Make executable, to avoid triggering a failed
consistency test in "make check".
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a patch I've been meaning to put in for years.
When I added support for "grep -r", I forgot to have "grep -r PAT"
search the working directory by default, instead of searching
standard input (which makes no sense, even if stdin is a directory).
This is not an upward compatible change, since "grep -r PAT <file"
will no longer search standard input, but that's OK; nobody should
be using "grep -r" that way anyway.
* NEWS: Document this.
* doc/grep.texi (File and Directory Selection, grep Programs, Usage):
Likewise.
* src/main.c (usage): Likewise.
(grepdir): If DIR is null, search the working directory, but do
not prepend "./" to the file names.
(main): If recursing and no operands are given, search ".".
* tests/Makefile.am (TESTS): Add r-dot.
* tests/r-dot: New file.
|
|
|
|
|
|
|
| |
* lib/colorize.h (print_end_colorize):
* lib/ms/colorize-impl.c (print_end_colorize):
Use fputs instead of printf.
* src/main.c (usage): Likewise. Use _ instead of gettext.
|
|
|
|
|
|
|
|
|
|
|
| |
* NEWS: Document this.
* src/main.c (grepfile): Revamp tests for input files so that
standard input is tested like other files. For example, report
an error if standard input equals standard output.
Prefer open+fstat to stat+open if possible, as open+fstat is
usually a bit faster and avoids a race condition.
* tests/in-eq-out-infloop: Add tests for cases like
'grep pat <file >>file'.
|
|
|
|
| |
Run "make update-copyright".
|
|
|
|
|
|
|
|
|
| |
These names used to be macros, but they're functions now.
All callers changed.
* src/main.c (pr_sgr_start): Rename from PR_SGR_START.
(pr_sgr_end): Rename from PR_SGR_END.
(pr_sgr_start_if): Rename from PR_SGR_START_IF.
(pr_sgr_end_if): Rename from PR_SGR_END_IF.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* cfg.mk (exclude_file_name_regexp--sc_prohibit_strcmp)
(exclude_file_name_regexp--sc_require_config_h)
(exclude_file_name_regexp--sc_require_config_h_first):
New rules.
* lib/colorize.c, lib/colorize.h, lib/colorize-impl.c:
* lib/ms/colorize.h, lib/ms/colorize-impl.c: New files.
* configure.ac (GREP_SRC_INCLUDES): New macro.
* lib/Makefile.am (libgreputils_a_SOURCES): Add colorize.[ch].
(EXTRA_DIST): New macro.
* src/Makefile.am (DEFAULT_INCLUDES): New macro.
* src/main.c: Include colorize.h.
(PR_SGR_START, PR_SGR_END, PR_SGR_START_IF, PR_SGR_END_IF):
Now static functions, not macros.
(hstdout, norm_attr, w32_console_init, w32_sgr2attr)
(w32_clreol) [__MINGW32__]: Move to lib/ms/colorize-impl.c.
(pr_sgr_start, pr_sgr_end): Remove; callers changed to use new
print_start_colorize, print_end_colorize from colorize.h.
(init_colorize): Rename from w32_console_init and move to
colorize module; caller changed.
(should_colorize): Move to colorize module.
|
|
|
|
|
|
|
|
|
|
| |
* src/main.c (grepfile): Just use SAME_INODE; don't bother
with SAME_REGULAR_FILE. This works better on properly-working
POSIX hosts, since it handles the case where the file is changing
as we grep it. It works worse on hosts that don't support st_ino
properly, but in practice this isn't that much of a problem here.
* src/system.h (same_file_attributes, SAME_REGULAR_FILE):
Remove; no longer needed.
|
| |
|
|
|
|
|
|
| |
* README.DOS: Remove file.
* m4/djgpp.m4: Likewise.
* .gitignore: Remove reference to m4/djgpp.m4.
|
|
|
|
|
| |
* Makefile.am (EXTRA_DIST): Add ChangeLog-2009.
Spotted by Eli Zaretskii.
|
|
|
|
|
|
| |
* src/main.c (color_dict, fg_color, bg_color, cap): Declare const.
No semantic change.
|
|
|
|
|
| |
* src/main.c: Correct many formatting inconsistencies.
No semantic change.
|
|
|
|
|
|
| |
* cfg.mk (old_NEWS_hash): Update, to accommodate old NEWS modification.
* src/main.c: Indent solely with spaces, never with TABs.
(should_colorize): Remove useless parens in #if directive.
|
|
|
|
|
| |
* src/main.c (parse_grep_colors): Fix indentation.
(usage): Mention MS-Windows in help text for -U and -u options.
|
|
|
|
| |
* NEWS: Mention MS-Windows related bugfixes and enhancements.
|
|
|
|
|
|
|
|
| |
* tests/include-exclude: Use --directories=skip, to avoid
gratuitous failures on systems that cannot grep directories.
* tests/reversed-range-endpoints: Don't reject program names with
leading directories and drive letters.
* tests/warn-char-classes: Likewise.
|
|
|
|
|
|
|
|
|
| |
* src/main.c (SGR_START, SGR_END, PR_SGR_FMT, PR_SGR_FMT_IF): Remove.
(PR_SGR_START, PR_SGR_START_IF): Replace with pr_sgr_start.
(PR_SGR_END, PR_SGR_END_IF): Replace with pr_sgr_end.
(pr_sgr_start, pr_sgr_end, should_colorize): New functions.
(w32_console_init, w32_sgr2attr, w32_clreol) [__MINGW32__]: New functions.
(main): Use should_colorize. Invoke w32_console_init.
|
|
|
|
|
|
|
|
|
|
|
| |
grep no longer silently suppresses errors when reading a directory
as if it were a text file. For example, "grep x ." now reports a
read error on most systems; formerly, it ignored the error.
Problem reported as an aside by Bob Proulx (Bug#10355).
* NEWS: Document this.
* src/main.c (grep, grepfile): Implement this. Simplify the code
considerably.
* src/system.h (is_EISDIR): Remove; no longer needed.
|
|
|
|
|
|
|
|
|
|
| |
--include and --exclude apply only to non-directories and
--exclude-dir applies only to directories. "-" (standard input)
is never excluded, since it is not a file name.
This bug was discovered while fixing a read-directory bug (Bug#10355).
* NEWS: Document this.
* src/main.c (main): Implement this.
* tests/include-exclude: Test for it.
|
| |
|
|
|
|
|
| |
* doc/grep.texi: General editing for improved aesthetics.
Also fix a few problems.
|
|
|
|
|
|
|
|
|
| |
* bootstrap.conf (gnulib_modules): Add iswctype and wcscoll.
* configure.ac: Remove explicit checks for those functions.
* src/mbsupport.h (MBS_SUPPORT): Define to 1 if not already defined.
Remove the conditional, now that we're guaranteed by gnulib to have
wcscoll and iswctype.
Suggested by Alan Hourihane in http://savannah.gnu.org/bugs/?34930
|
|
|
|
|
|
|
| |
* src/main.c (grepfile): Do not reject input == output also
when using a few other options.
* tests/in-eq-out-infloop: Test these new cases.
* NEWS (Bug fixes): Mention it
|
|
|
|
|
|
|
|
|
|
|
|
| |
The recent fix to avoid an infinite disk-filling loop, commit 5e20a38a,
introduced a minor regression. If you use grep with -q and -r, and
redirect output to a file that will be traversed, then grep would
reject the command, even though it will generate no output.
In that case, there is no risk of an infinite loop.
* src/main.c (grepfile): Do not reject input == output when
using --quiet/--silent (-q).
Reported by J H Wilson in http://bugs.mageia.org/show_bug.cgi?id=3501
forwarded by Nicolas Vigier to https://savannah.gnu.org/bugs/?34917
|
|
|
|
|
|
| |
* src/dfa.c (using_utf8) [!MBS_SUPPORT]: Remove erroneous "defined"
in cpp test for MBS_SUPPORT. Since commit a163349d, MBS_SUPPORT is 0/1.
This error caused trouble only in the !MBS_SUPPORT case.
|
|
|
|
|
| |
* src/dfa.c (setbit_wc) [!MBS_SUPPORT]: Add explicit "return false;"
after "abort ();", to avoid a warning from deficient compilers.
|