summaryrefslogtreecommitdiff
path: root/NEWS
Commit message (Collapse)AuthorAgeFilesLines
* maint: update copyright dates for 2014Jim Meyering2014-01-011-1/+1
| | | | Do that by running "make update-copyright".
* grep: handle lines longer than INT_MAX on more systemsJim Meyering2013-12-181-0/+2
| | | | | | | | | | | | | | | | | | | | | | When trying to exercize some long-line-handling code, I ran these commands: $ dd bs=1 seek=2G of=big < /dev/null; grep -l x big; echo $? grep: big: Invalid argument 2 grep should not have issued that diagnostic, and it should have exited with status 1, not 2. What happened? grep read the 2GiB of NULs, doubled its buffer size, copied the 2GiB into the new 4GiB buffer, and proceeded to call "read" with a byte-count argument of 2^32. On at least Darwin 12.5.0, that makes read fail with EINVAL. The solution is to use gnulib's safe_read wrapper. * src/main.c: Include "safe-read.h" (fillbuf): Use safe_read, rather than bare read. The latter cannot handle a read size of 2^32 on some systems. * bootstrap.conf (gnulib_modules): Add safe-read. * tests/long-line-vs-2GiB-read: New file. * tests/Makefile.am (TESTS): Add it. * NEWS (Bug fixes): Mention it.
* grep: fix regression with -P vs. invalid UTF-8 inputJim Meyering2013-11-021-0/+6
| | | | | | | | | | | | * src/pcresearch.c (Pexecute): Don't abort upon unexpected PCRE-specific error code. Explicitly handle PCRE_ERROR_BADUTF8, and change the default to print a diagnostic including the unhandled integer PCRE error code and exit with status 2. * tests/pcre-invalid-utf8-input: New file. * tests/Makefile.am (TESTS): Add it. * NEWS (Bug fixes): Mention it. * THANKS: Update. Reported by Dave Reisner in http://bugs.gnu.org/15758.
* grep: fix regression involving \s and \SJim Meyering2013-11-021-0/+5
| | | | | | | | | | | | Commit v2.14-40-g01ec90b made \s and \S work with multi-byte characters, but it made it so any use like \s*, \s+, \s?, \s{3} would malfunction in a multi-byte locale. * src/dfa.c (lex): Also reset laststart. * tests/backslash-s-and-repetition-operators: New file. * tests/Makefile.am (TESTS): Add it. * NEWS (Bug fixes): Mention it. * THANKS: Update. Reported by Mirraz Mirraz in http://bugs.gnu.org/15773.
* maint: NEWS: document a release-related bug fixJim Meyering2013-11-011-0/+7
| | | | * NEWS (Bug fixes): Add an entry for a fix pulled from gnulib.
* maint: post-release administriviaJim Meyering2013-10-261-0/+3
| | | | | | * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update.
* version 2.15v2.15Jim Meyering2013-10-261-1/+1
| | | | * NEWS: Record release date.
* maint: fix typo in NEWSJim Meyering2013-10-191-3/+4
| | | | | | | * NEWS: Fix/improve example commands in most recent entry. The LC_ALL envvar setting goes before grep, not before printf. Don't reference src/ in the second example command, and do specify the locale.
* dfa: fix \s and \S to work for multibyteJim Meyering2013-10-011-0/+7
| | | | | | | | | | * src/dfa.c (lex): In multibyte mode, we can't treat \s and \S as we do in single-byte mode. Map them to [[:space:]] and [^[:space:]] respectively, to make the DFA matcher use the regex-matcher for this term. * tests/multibyte-white-space: New file. Test for the bug. * tests/Makefile.am (TESTS): Add it. This bug was introduced with the addition of DFA support for \s and \S in commit v2.5.4-112-gf979ca0.
* maint: change all references: s/POSIX\.2/POSIX/Jim Meyering2013-09-301-2/+2
| | | | | | | | | | | | | There is no longer any point in referring to POSIX.N. POSIX is sufficient. * doc/grep.in.1: As above. * src/main.c (main): Likewise. * tests/file: Likewise. * tests/options: Likewise. * ChangeLog: Likewise. * NEWS: Likewise. * cfg.mk: Update, to match changed NEWS. Inspired by Glenn Golden's suggestion in http://bugs.gnu.org/15486
* fix Cygwin UTF-16 surrogate-pair handling with -iCorinna Vinschen2013-09-011-0/+6
| | | | | | | | | | | | | grep -i would segfault on systems using UTF-16-based wchar_t (Cygwin) when converting an input string containing certain 4-byte UTF-8 sequences to lower case. The conversions to wchar_t and back to a UTF-8 multibyte string did not take surrogate pairs into account. * src/searchutils.c (mbtolower) [__CYGWIN__]: Detect and handle surrogate pairs when converting. * NEWS (Bug fixes): Mention it. * tests/surrogate-pair: New test. * tests/Makefile.am (TESTS): Add it. Reported by: Jim Burwell
* doc: NEWS: mention the DFA segfault fixJim Meyering2013-08-091-0/+5
| | | | * NEWS (Bug fixes): List the DFA segfault fix.
* grep -F: avoid an infinite loop with invalid multi-byte search stringJim Meyering2013-05-281-0/+4
| | | | | | | | | | | * src/kwsearch.c (Fexecute): Avoid an infinite loop when processing a fixed (-F) multibyte search string that is an invalid byte sequence in the current locale and that matches the bytes of the input twice on a line. Reported by Daisuke GOTO in http://thread.gmane.org/gmane.comp.gnu.grep.bugs/4773 * tests/invalid-multibyte-infloop: New test. * tests/Makefile.am (TESTS): Add it. * NEWS (Bug fixes): Mention it.
* doc: document EREs like a{,10}Paul Eggert2013-04-181-0/+2
| | | | | | | | | | Problem reported by Eric Blake in <http://lists.gnu.org/archive/html/bug-grep/2013-04/msg00005.html>. * NEWS: Document the bug fix. * doc/grep.in.1: Restore documentation for this feature, but mention that it is a GNU extension. * doc/grep.texi (Fundamental Structure): Mention that this feature is a GNU extension.
* maint: update all copyright year number rangesJim Meyering2013-01-041-1/+1
| | | | Run "make update-copyright".
* pcre: add PCRE-JIT support for grepPaolo Bonzini2012-11-101-0/+7
| | | | | | | | * NEWS: Document new feature. * src/pcresearch.c [PCRE_STUDY_JIT_COMPILE] (jit_stack): New. [PCRE_STUDY_JIT_COMPILE] (Pcompile): JIT-compile the regular expression and allocate a stack for it. Based on a patch from Zoltan Herczeg. * THANKS: Add Zoltan to the list.
* maint: correct syntax-check failures; adjust NEWSJim Meyering2012-10-031-4/+5
| | | | | | | | | * tests/pcre-utf8: Reverse order of compare arguments. Remove all copyright year numbers except 2012. Use skip_ "diagnostic...", rather than a bare "exit 77". * NEWS: Start with a concise description of the bug. * src/pcresearch.c (STREQ): Define, so that we can... (Pcompile): use STREQ, not strcmp.
* pcresearch: set UTF-8 flag correctly for UTF-8 localesPetr Pisar2012-10-031-0/+6
| | | | | | | | Otherwise, Unicode properties (\p{XXX}) do not work with characters outside the 7-bit ASCII character set. * src/pcresearch.c (Pcompile): Look for UTF-8 locales and set PCRE_UTF8 if one is found.
* maint: post-release administriviaJim Meyering2012-08-201-0/+3
| | | | | | * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update.
* version 2.14v2.14Jim Meyering2012-08-201-1/+1
| | | | * NEWS: Record release date.
* grep -i '^$' in a multi-byte locale could report a false matchJim Meyering2012-08-071-0/+7
| | | | | | | | | | | | | * src/dfasearch.c (EGexecute): Do not match the sentinel "newline" that is appended to each buffer. This bug may sound like a big deal (it certainly surprised me), but realize that only the empty-line-matching regular expression '^$' can trigger it, and then only when you add the unnecessary (and arguably superfluous) -i, *and* run the command in a multi-byte locale. Using a multi-byte locale for such a regular expression is also pointless, and hurts performance. * NEWS (Bug fixes): Mention it. Reported by Alexander Katassonov <katasso@gmx.de>
* grep: don't falsely report compressed text files as binaryPaul Eggert2012-07-271-2/+2
| | | | | | | | | * NEWS: Document this. * src/main.c (file_is_binary): Remove the heuristic based on st_blocks, as it does not work for compressed file systems. On Solaris, it'd be cheap to test whether the file system is known to be uncompressed, which allow the heuristic, but Solaris has SEEK_HOLE so there's little point.
* grep: don't falsely report tiny text files as binaryPaul Eggert2012-07-271-0/+5
| | | | | | | | * NEWS: Document this. * src/main.c (file_is_binary): When we are already at apparent EOF, skip the file-size check, as some servers use zero blocks to store binary files. Reported by Martin Carroll in <http://lists.gnu.org/archive/html/bug-grep/2012-07/msg00016.html>.
* maint: post-release administriviaJim Meyering2012-07-041-0/+3
| | | | | | * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update.
* version 2.13v2.13Jim Meyering2012-07-041-1/+1
| | | | * NEWS: Record release date.
* grep -i: work also when converting to lower-case inflates byte countJim Meyering2012-06-161-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit v2.12-16-g7aa698d addressed the case in which the lower-case representation of an input byte occupies fewer bytes than the original. However, even with commit v2.12-20-g074842d, grep -i would still misbehave when converting a character to lower-case increased its byte count. The map-manipulation code assumed that the case conversion could only shrink the byte count. With the consideration that it may also inflate it, the deltas recorded in the map array must be signed, and we must account for the one-to-two-or-more mapping when the original-to-lower-case conversion causes the byte count to increase. * src/searchutils.c (mbtolower): When a lower-case character occupies more than one byte, set its remaining map slots to zero. Change the type of the map to be signed, and compute the change in character byte count as new_length - old_length. * src/search.h: Include <stdint.h>, for decl of intmax_t. (mb_case_map_apply): Adjust for signed increments: each map entry is now signed. (mb_len_map_t): Define type. Thanks to Paul Eggert for noticing in review that using a bare "char" as the base type would be wrong on systems for which it is a signed type (as with gcc's -funsigned-char). * src/kwsearch.c (Fcompile, Fexecute): Likewise. * src/dfasearch.c (kwsincr_case, EGexecute): Likewise. * tests/turkish-I-without-dot: New test. Thanks to Paolo Bonzini for the tip that in the tr_TR.utf8 locale, mapping "I" to lower case increases the character's byte count. * tests/Makefile.am (TESTS): Add it. * tests/init.cfg (require_tr_utf8_locale_): New function. * NEWS (Bug fixes): Expand the existing entry.
* grep: fix how -i works with a match containing the Turkish I-with-dotJim Meyering2012-06-021-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a long-standing problem in the way grep's -i interacts with data whose byte count changes when we convert it to lower case. For example, the UTF-8 Turkish I-with-dot (İ) occupies two bytes, but its lower case analog, i, occupies just one byte. The code converts both search string and the haystack data to lower case, and then searches for the modified string in the modified buffer. The trouble arose when using a lowercase buffer <offset,length> pair to manipulate the original (longer) buffer. The solution is to change mbtolower to return additional information: a malloc'd mapping vector. With that, the caller maps the lowercase- relative <offset,length> to numbers that refer to the original buffer. This mapping is used only when lengths actually differ, so the cost in general should be small. * src/searchutils.c (mbtolower): Add the new map parameter. * src/search.h (mb_case_map_apply): New function. * src/kwsearch.c (Fexecute): Update mbtolower caller, and upon success, apply the new map. * src/dfasearch.c (EGexecute): Likewise. * tests/Makefile.am (XFAIL_TESTS): Remove turkish-I from this list; that test is no longer expected to fail. * NEWS (Bug fixes): Mention it. Reported by Ilya Basin in http://thread.gmane.org/gmane.comp.gnu.grep.bugs/3413 and later by Strahinja Kustudic in http://savannah.gnu.org/bugs/?36567
* maint: avoid nit-picky syntax-check test failure; tweak big-hole testJim Meyering2012-05-161-0/+2
| | | | | | | * NEWS: Restore deleted newline in "old" NEWS, to fix a syntax-check test failure. * tests/big-hole: Use awk, rather than a shell loop: saves 3000 lines of verbose shell output in the .log file.
* grep: sparse files are now considered binaryPaul Eggert2012-05-151-1/+5
| | | | | | | | | | | | | * NEWS: Document this. * doc/grep.texi (File and Directory Selection): Likewise. * bootstrap.conf (gnulib_modules): Add stat-size. * src/main.c: Include stat-size.h. (usable_st_size): New function, mostly stolen from coreutils. (fillbuf): Use it. (file_is_binary): New function, which looks for holes too. (grep): Use it. * tests/Makefile.am (TESTS): Add big-hole. * tests/big-hole: New file.
* maint: quote 'like this' or "like this", not `like this'Paul Eggert2012-05-061-21/+21
| | | | | | | | | | | | | | | | See <http://lists.gnu.org/archive/html/bug-grep/2012-01/msg00125.html>. * ChangeLog-2009, HACKING, NEWS, README-hacking, cfg.mk, configure.ac: * lib/colorize-w32.c, m4/pcre.m4: * src/Makefile.am, src/dfa.c, src/dosbuf.c, src/main.c: * tests/backref, tests/help-version, tests/tests: In commentary, quote 'like this' or "like this" rather than `like this' or ``like this''. * cfg.mk (old_NEWS_hash): Update due to changed old NEWS. * doc/grep.texi (General Output Control): Quote sample text with @samp, not with `...'. * src/main.c (usage): * tests/help-version: Quote 'like this' rather than `like this' in diagnostics.
* exclude: process exclude and include directives in orderPaul Eggert2012-05-061-0/+7
| | | | | | | | | | | | | | | | | | | Also, change exclude and include directives so that they apply to command-line arguments too. This restores the pre-2.6 behavior, and fixes a bug reported by Quentin Arce in <http://lists.gnu.org/archive/html/bug-grep/2012-04/msg00056.html>. * NEWS: Document this. * src/main.c (included_patterns): Remove. All uses removed. (skipped_file): New function. (grepdirent): New arg command_line; all callers changed. This is needed because non-command-line files can invoke fts_open, and their directory entries need to be distinguished from top-level directory entries. Move code into the new skipped_file function. (grepdesc): Check whether a command-line argument should be skipped. (main): --include and --exclude options now share excluded_patterns rather than having separate variables included_patterns and excluded_patterns. * tests/include-exclude: Add a test to detect the fixed bug.
* drop support for Makefile.bootPaolo Bonzini2012-04-271-0/+4
| | | | | | | | * Makefile.am: Do not distribute README-boot and Makefile.boot. * NEWS: Mention this change. * README-alpha: Do not mention README-boot and Makefile.boot. * Makefile.boot: Remove. * README-boot: Remove.
* maint: post-release administriviaJim Meyering2012-04-231-0/+3
| | | | | | * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update.
* version 2.12v2.12Jim Meyering2012-04-231-1/+1
| | | | * NEWS: Record release date.
* grep: fix --devices=ACTION (-D) so stdin is once again exemptJim Meyering2012-04-171-1/+6
| | | | | | | | | | | | | | | An oversight in the 2.11 changes made it so "echo x|grep x" would fail for those who set GREP_OPTIONS=--devices=skip. * src/main.c (grepdesc): Ignore skip-related options when reading from standard input. * tests/skip-device: New file. Test for the above. * tests/Makefile.am (TESTS): Add it. * doc/grep.texi (File and Directory Selection): Clarify this point, documenting the stdin exemption. * NEWS (Bug fixes): Mention it, and add a few "[fixed in ...] notes. Reported by Tino Keitel in http://bugs.debian.org/669084, and forwarded to bug-grep by Aníbal Monsalve Salazar.
* grep: report overflow for ERE a{1000000000}Paul Eggert2012-03-181-0/+3
| | | | | | | | | | | | | | | | | | * NEWS: Document this. * src/dfa.c (MIN): New macro. (lex): Lexically analyze the repeat-count operator once, not twice; the double-scan complicated the code and made it harder to understand and fix. Adjust the repeat-count parsing so that it better matches the behavior of the regex code, in three ways: 1. Diagnose too-large repeat counts rather than treating them as literal characters. 2. Use RE_INVALID_INTERVAL_ORD, not RE_NO_BK_BRACES, to decide whether to treat invalid-syntax {...}s as literals. 3. Use the same wording for {...}-related diagnostics that the regex code uses. * tests/bre.tests, tests/ere.tests, tests/repetition-overflow: Adjust to match new behavior, and add a few tests. * cfg.mk (exclude_file_name_regexp--sc_error_message_uppercase): New macro, since the diagnostics start with uppercase letters.
* grep: -r no longer follows symlinks; use ftsPaul Eggert2012-03-141-2/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change -r to follow only command-line symlinks, and by default to read only devices named on the command line. This is a simple way to get a more-useful behavior when searching random directories; the idea is to use 'find' if you want something fancy. -R acts as before and gets a new alias --dereference-recursive. The code now uses fts internally, so it is more robust and faster with large hierarchies. * .gitignore: Remove lib/savedir.c, lib/savedir.h. * tests/symlink: New file * Makefile.boot (LIB_OBJS_core): Remove isdir.o, savedir.o. Perhaps other changes are needed too, but I'm not sure what this makefile is for. * NEWS: Document changes. * doc/grep.texi (File and Directory Selection): Likewise. * bootstrap.conf (gnulib_modules): Remove dirent, dirname, isdir, open. Add fstatat, fts, openat-safer. * lib/Makefile.am (libgreputils_a_SOURCES): Remove savedir.c, savedir.h. * lib/savedir.c, lib/savedir.h: Remove. * po/POTFILES.in: Add lib/openat-die.c. * src/main.c: Include fcntl-safer.h, fts_.h. Don't include isdir.h, savedir.h. (struct stats, stats_base): Remove. (long_options, usage, main): Add --dereference-recursive and implement -r vs -R. (filename_prefix_len, fts_options): New static vars. (basic_fts_options, READ_COMMAND_LINE_DEVICES): New constants. (devices): Now defaults to READ_COMMAND_LINE_DEVICES. (reset, grep): Now takes just struct stat rather than file name and struct stats. All callers changed. (fillbuf): Now takes struct stat reather than struct stats. All callers changed. (grep): Don't worry about recursing too deeply; fts and grepdesc handle this now. (is_device_mode, grepdirent, grepdesc, grep_command_line_args): New functions. (grepfile): New args DIRDESC, FOLLOW, COMMAND_LINE. Remove struct stats arg. All callers changed. Use openat_safer rather than open. Use desc == STDIN_FILENO to tell whether we're reading "-". Don't worry about EINTR when closing -- not possible, since we're not catching signals. * tests/Makefile.am (TESTS): Add symlink. * tests/symlink: New file.
* grep: fix segfault with -r --exclude-dir and no file operandAllan McRae2012-03-121-0/+5
| | | | | * src/main.c (grepdir): Don't invoke excluded_file_name on NULL. * NEWS (Bug fixes): Mention it.
* maint: post-release administriviaJim Meyering2012-03-021-0/+3
| | | | | | * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update.
* version 2.11v2.11Jim Meyering2012-03-021-1/+1
| | | | * NEWS: Record release date.
* maint: spelling fixesPaul Eggert2012-03-011-2/+2
|
* grep: fix integer-overflow issues in main programPaul Eggert2012-03-011-0/+5
| | | | | | | | | | | | | | | | | | * NEWS: Document this. * bootstrap.conf (gnulib_modules): Add inttypes, xstrtoimax. Remove xstrtoumax. * src/main.c: Include <inttypes.h>, for INTMAX_MAX, PRIdMAX. (context_length_arg, prtext, grepbuf, grep, grepfile) (get_nondigit_option, main): Use intmax_t, not int, for line counts. (context_length_arg, main): Silently ceiling line counts to maximum value, since there's no practical difference between doing that and using infinite-precision arithmetic. (out_before, out_after, pending): Now intmax_t, not int. (max_count, outleft): Now intmax_t, not off_t. (prepend_args, prepend_default_options, main): Use size_t, not int, for sizes. (prepend_default_options): Check for int and size_t overflow.
* grep: fix some core dumps with long lines etc.Paul Eggert2012-03-011-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These problems mostly occur because the code attempts to stuff sizes into int or into unsigned int; this doesn't work on most 64-bit hosts and the errors can lead to core dumps. * NEWS: Document this. * src/dfa.c (token): Typedef to ptrdiff_t, since the enum's range could be as small as -128 .. 127 on practical hosts. (position.index): Now size_t, not unsigned int. (leaf_set.elems): Now size_t *, not unsigned int *. (dfa_state.hash, struct mb_char_classes.nchars, .nch_classes) (.nranges, .nequivs, .ncoll_elems, struct dfa.cindex, .calloc, .tindex) (.talloc, .depth, .nleaves, .nregexps, .nmultibyte_prop, .nmbcsets): (.mbcsets_alloc): Now size_t, not int. (dfa_state.first_end): Now token, not int. (state_num): New type. (struct mb_char_classes.cset): Now ptrdiff_t, not int. (struct dfa.utf8_anychar_classes): Now token[5], not int[5]. (struct dfa.sindex, .salloc, .tralloc): Now state_num, not int. (struct dfa.trans, .realtrans, .fails): Now state_num **, not int **. (struct dfa.newlines): Now state_num *, not int *. (prtok): Don't assume 'token' is no wider than int. (lexleft, parens, depth): Now size_t, not int. (charclass_index, nsubtoks) (parse_bracket_exp, addtok, copytoks, closure, insert, merge, delete) (state_index, epsclosure, state_separate_contexts) (dfaanalyze, dfastate, build_state, realloc_trans_if_necessary) (transit_state_singlebyte, match_anychar, match_mb_charset) (check_matching_with_multibyte_ops, transit_state_consume_1char) (transit_state, dfaexec, free_mbdata, dfaoptimize, dfafree) (freelist, enlist, addlists, inboth, dfamust): Don't assume indexes fit in 'int'. (lex): Avoid overflow in string-to-{hi,lo} conversions. (dfaanalyze): Redo indexing so that it works with size_t values, which cannot go negative. * src/dfa.h (dfaexec): Count argument is now size_t *, not int *. (dfastate): State numbers are now ptrdiff_t, not int. * src/dfasearch.c: Include "intprops.h", for TYPE_MAXIMUM. (kwset_exact_matches): Now size_t, not int. (EGexecute): Don't assume indexes fit in 'int'. Check for overflow before converting a ptrdiff_t to a regoff_t, as regoff_t is narrower than ptrdiff_t in 64-bit glibc (contra POSIX). Check for memory exhaustion in re_search rather than treating it merely as failure to match; use xalloc_die () to report any error. * src/kwset.c (struct trie.accepting): Now size_t, not unsigned int. (struct kwset.words): Now ptrdiff_t, not int. * src/kwset.h (struct kwsmatch.index): Now size_t, not int.
* dfa: fix a subtle constraint encoding bugPaolo Bonzini2012-02-261-0/+5
| | | | | | | | | | | | * src/dfa.c (SUCCEEDS_IN_CONTEXT, PREV_NEWLINE_DEPENDENT, PREV_LETTER_DEPENDENT): Rewrite to handle all 3*3=9 possible combinations of previous and next character contexts. (MATCHES_NEWLINE_CONTEXT, MATCHES_LETTER_CONTEXT): Remove. (NO_CONSTRAINT, BEGLINE_CONSTRAINT, ENDLINE_CONSTRAINT, BEGWORD_CONSTRAINT, ENDWORD_CONSTRAINT, LIMWORD_CONSTRAINT, NOTLIMWORD_CONSTRAINT): Switch to new encoding. * NEWS: Document resulting bugfix. * tests/spencer1.tests: Add regression test.
* doc: document recent diagnostics-related changesPaul Eggert2012-01-221-0/+16
| | | | | * NEWS: Document changes re diagnostics related to GREP_COLORS, directory loops, -s, "write error".
* grep: with no args, search "." only if command-line -rPaul Eggert2012-01-041-2/+4
| | | | | | | | | * 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.
* deprecate the --mmap optionJim Meyering2012-01-031-0/+6
| | | | | | | | * 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.
* grep: -r with no args now searches "."Paul Eggert2012-01-021-0/+3
| | | | | | | | | | | | | | | | | | | 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.
* grep: check stdin like other filesPaul Eggert2012-01-011-0/+4
| | | | | | | | | | | * 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'.
* maint: update all copyright year number rangesJim Meyering2012-01-011-1/+1
| | | | Run "make update-copyright".