2020-01-02  Jim Meyering  <meyering@fb.com>

	version 3.4
	* NEWS: Record release date.

	build: update gnulib to latest, for mbrtowc-vs-Irix build fix

2020-01-02  Paul Eggert  <eggert@cs.ucla.edu>

	doc: fix --exclude description in man page
	Problem reported by Duncan Moore (Bug#37212).
	* src/grep.c (usage): Fix incorrect statement about --exclude
	and directories.  Standardize on “that match GLOB” instead
	of “matching GLOB”.

	doc: fix missing “more” in man page
	Problem reported by Philippe Schnoebelen (Bug#34078).
	* doc/grep.in.1: Add missing “more”.

2020-01-01  Paul Eggert  <eggert@cs.ucla.edu>

	doc: add [:blank:] to man page
	* doc/grep.in.1: Mention [:blank:] (Bug#33291).

2020-01-01  Jim Meyering  <meyering@fb.com>

	maint: update all copyright year number ranges
	Run "make update-copyright" and then...
	* gnulib: Update to latest with copyright year adjusted.
	* tests/init.sh: Sync with gnulib to pick up copyright year.
	* bootstrap: Likewise.
	* doc/grep.in.1: Use "-" in copyright year ranges, not \en.

2019-12-31  Jim Meyering  <meyering@fb.com>

	tests: avoid unwarranted failure in a netbsd 8.1 VM
	* tests/mb-non-UTF8-perf-Fw: Run twice, to avoid first-read penalty.
	Reported by Nelson H.F. Beebe.

2019-12-30  Jim Meyering  <meyering@fb.com>

	build: update gnulib to latest (for localeinfo perf fix)

	maint: add syntax-check rule to prohibit "backreference" spelling
	* cfg.mk (sc_prohibit_backref): New rule.

2019-12-30  Paul Eggert  <eggert@cs.ucla.edu>

	maint: remove too-long line from AUTHORS
	* AUTHORS: Remove URL that’s too long.

	maint: update AUTHORS
	* AUTHORS: Update to better reflect current authorship.

2019-12-30  Jim Meyering  <meyering@fb.com>

	avoid new syntax-check failures
	* cfg.mk (old_NEWS_hash): Updating old news, we must also udpate this.

2019-12-30  Paul Eggert  <eggert@cs.ucla.edu>

	doc: don’t encourage back-references
	* doc/grep.texi (Usage): Remove palindrome question.  Bondioni’s
	RE makes grep issue a ‘grep: stack overflow’ diagnostic, and we
	shouldn’t be encouraging fancy back-references anyway, due to all
	the bugs in this area (Bug#26864).  Plus, the allusion to
	“GNU extensions” doesn't seem to be correct here.

	doc: robustify some examples
	Prompted by suggestions by Stephane Chazelas (Bug#38792#20).
	* doc/grep.texi (Usage): Make examples more robust.

	doc: fix bug# typo

	doc: spell "back-reference" more consistently

	doc: mention back-reference bugs
	Inspired by Bug#26864.
	* doc/grep.texi (Known Bugs): New section.
	Mention back-reference issues.

2019-12-29  Paul Eggert  <eggert@cs.ucla.edu>

	doc: Add -- to more-complex example
	Suggested by Stephane Chazelas (Bug#38792).
	* doc/grep.in.1, doc/grep.texi: Add ‘--’ to recently-added example.

	doc: improve subsection title (Bug#26132)
	* doc/grep.in.1: Rename "Matcher Selection" to "Pattern Syntax".

	doc: fix typo in previous patch

	doc: document quoting better
	Problem reported by Martin Simons (Bug#38792).
	* doc/grep.texi: Fix quoting used in examples.  Say that patterns
	should be quoted, use quoting more consistently in examples, and
	give an example illustrating the difference between patterns and
	globbing.  Don’t assume zgrep expertise in example.
	* doc/grep.in.1: Likewise.  Also, reorder sections
	to match GNU/Linux man-pages style.

2019-12-26  Jim Meyering  <meyering@fb.com>

	maint: tweak NEWS wording
	* NEWS: Minor wording change.

	build: update gnulib to latest; and sync tests/init.sh
	* gnulib: update
	* tests/init.sh: Sync from gnulib (this removes the LC_ALL=C setting).

	tests: avoid spurious failure due to 1-second timeout
	* tests/grep-dev-null-out: Use a 10-second timeout, rather than
	a 1-second one.  This avoids false failure on slow systems.
	Reported by Assaf Gordon in
	https://lists.gnu.org/r/grep-devel/2019-12/msg00018.html

2019-12-26  Paul Eggert  <eggert@cs.ucla.edu>

	build: update gnulib submodule to latest

	maint: adjust surrogate-pair for 16-bit wchar_t
	* tests/surrogate-pair: Adjust to match fixed behavior
	on AIX 7.2, where wchar_t is 16 bits and cannot represent
	the test case data.

2019-12-25  Jim Meyering  <meyering@fb.com>

	tests: fix typo in name of test file
	* tests/backslash-s-vs-invalid-multitype: Rename to...
	* tests/backslash-s-vs-invalid-multibyte: ...this.
	* tests/Makefile.am (TESTS): Reflect renaming.

	tests: ensure we use require_timeout_ when needed
	* cfg.mk (sc_timeout_prereq): New syntax-check rule.

	tests: require timeout
	* tests/mb-non-UTF8-perf-Fw: This test uses "timeout",
	so must first call require_timeout_.
	This avoids test spurious failure when running with
	no timeout program. Reported by Bruno Haible in
	https://lists.gnu.org/r/grep-devel/2019-12/msg00008.html

2019-12-25  Paul Eggert  <eggert@cs.ucla.edu>

	tests: work around AIX 7.2 sh printf bug
	AIX 7.2 /bin/sh’s printf command mishandles octal escapes
	in multibyte locales: it treats them as characters, not bytes.
	* tests/backslash-s-vs-invalid-multitype, tests/encoding-error:
	Use the C locale when employing the printf command with an octal
	escape that AIX 7.2 sh might mishandle.
	* tests/init.sh (setup_): Use the C locale for tests.
	This has the side benefit of making them more reproducible.

2019-12-22  Jim Meyering  <meyering@fb.com>

	maint: adjust new comments
	* src/dfasearch.c (possible_backrefs_in_pattern): Remove a
	duplicate "a", insert a "be" and a comma, and reformat.

	build: update gnulib to latest
	* gnulib: Update submodule to latest.
	* bootstrap: Copy from gnulib.
	* tests/init.sh: Likewise.

2019-12-22  Paul Eggert  <eggert@cs.ucla.edu>

	grep: fix some bugs in pattern-grouping speedup
	This fixes some bugs in the previous commit,
	and should finish the fix for Bug#33249.
	* NEWS: Mention fix for Bug#33249.
	* src/dfasearch.c (possible_backrefs_in_pattern, regex_compile)
	(GEAcompile): In new code, prefer ptrdiff_t to size_t when either
	will do, since ptrdiff_t has better error checking.  At some point
	we should adjust the old code too.
	(possible_backrefs_in_pattern): Rename from
	find_backref_in_pattern.  New arg BS_SAFE.  All uses changed.
	Fix false negative if a multibyte character ends in a single
	'\\' byte, followed by the two bytes '\\', '1'.
	(regex_compile): Simplify.
	(GEAcompile): Avoid quadratic behavior when reallocating growing
	buffers.  Fix a couple of bugs in copying pattern data involving
	backreferences.  Fix another bug in copying pattern metadata
	involving backreferences, by removing the need to copy it.

2019-12-22  Norihiro Tanaka  <noritnk@kcn.ne.jp>

	grep: grouping of a pattern with multiple lines
	When grep uses regex, it splits a pattern with multiple lines by
	newline character into fragments.  Compilation and execution run for
	each fragment.  That causes slowdown.  By this change, each fragment is
	divided into groups by whether the fragment includes back references.
	A fragment with back references constitutes group, and all fragments
	that lack back references also constitute a group.

	This change extremely speeds-up following case.

	  $ seq -f '%040g' 0 9999 | sed '1s/$/\\(0\\)\\1/' >pat
	  $ yes 00000000000000000000000000000000000000000x | head -10000 >in
	  $ time -p env LC_ALL=C src/grep -f pat in

	* src/dfasearch.c (find_backref_in_pattern, regex_compile):
	New functions.
	(GEAcompile): Use the new functions to group fragments
	as mentioned above.

2019-12-19  Paul Eggert  <eggert@cs.ucla.edu>

	maint: add NEWS for Bug#34951 fix
	* NEWS: Mention Bug#34951.

2019-12-19  Norihiro Tanaka  <noritnk@kcn.ne.jp>

	dfa: separate parse and compile phase
	DFAMUST() must be called after parse and before tokens re-order which is
	introduced in commit 5c7a0371823876cca7a1347fa09ca26bbbff0c98, but both are
	executed in compilation phase.

	* lib/dfa.c (dfaparse): Change it to global function.
	(dfacomp): If first argument is NULL, skip parse.
	* lib/dfa.h: (dfaparse): Add a prototype.

2019-12-19  Paul Eggert  <eggert@cs.ucla.edu>

	build: update gnulib submodule to latest

2019-12-19  Norihiro Tanaka  <noritnk@kcn.ne.jp>

	grep: speed up multiple word matching
	grep uses its KWset matcher for multiple word matching, but that is
	very slow when most of the parts matched to a pattern are not words.
	So, if the first match to a pattern is not a word, use the grep matcher
	to match for its line.

	Note that when START_PTR is set, the grep matcher uses the regex matcher
	which is very slow to match words.  Therefore, we use the grep matcher
	when only START_PTR is NULL.

	* src/kwsearch.c (Fexecute): If an initial match is incomplete because
	not on a word boundary, use the grep matcher to find a matching line.

2019-12-18  Jim Meyering  <meyering@fb.com>

	maint: sort test names
	* tests/Makefile.am (TESTS): Alphabetize the new addition,
	mb-non-UTF8-perf-Fw to placate syntax-check's sc_sorted_tests.

2019-12-18  Paul Eggert  <eggert@cs.ucla.edu>

	maint: adjust to recent Gnulib change
	* po/POTFILES.in: Remove lib/xstrtol-error.c.

2019-12-17  Paul Eggert  <eggert@cs.ucla.edu>

	grep: do not match invalid UTF-8
	Update Gnulib to latest.  Also:
	* src/dfasearch.c (EGexecute): Use ptrdiff_t, not size_t,
	to match new Gnulib API.
	* tests/Makefile.am (TESTS): Add dfa-invalid-utf8.
	* tests/dfa-invalid-utf8: New file.

2019-11-30  Jim Meyering  <meyering@fb.com>

	tests: add test that would have detected -Fw perf regression
	* tests/mb-non-UTF8-perf-Fw: New file. Detect v3.3-22-g090a4db's
	performance regression.
	* tests/Makefile.am (TESTS): Add it.

2019-11-29  Jim Meyering  <meyering@fb.com>

	maint: fix test comment
	* tests/mb-non-UTF8-word-boundary: Also correct "introduced-in"
	version number in a comment here.

2019-11-25  Jim Meyering  <meyering@fb.com>

	maint: correct NEWS blurb
	* NEWS (Bug fixes): Correction: the -Fw bug was introduced
	in 2.28, not in 3.0. Reported by Paul Eggert.

2019-11-17  Norihiro Tanaka  <noritnk@kcn.ne.jp>

	grep: improve grep -Fw performance in non-UTF8 multibyte locales
	* src/searchutils.c (mb_goback): New parameter.  All callers changed.
	* src/search.h (mb_goback): Update prototype.
	* src/kwsearch.c (Fexecute): Use mb_goback's MBCLEN to detect a
	word-boundary even more efficiently.

	grep: fix performance regression with previous patch
	* src/kwsearch.c (Fexecute): Avoid unnecessary back-up in non-UTF8
	multibyte locales.

2019-11-16  Jim Meyering  <meyering@fb.com>

	maint: rename a variable: bol -> nl
	* src/kwsearch.c (Fexecute): Change misleading name: s/bol/nl/

	build: update gnulib to latest

	maint: correct and clarify a comment
	* src/kwsearch.c (Fexecute): Logic was reversed.

	grep: avoid false -Fw match in non-UTF8 multibyte locales
	For example, this command would erroneously print its input line:
	  echo ab | LC_CTYPE=ja_JP.eucjp grep -Fw b
	This arose when the "memrchr" search for a preceding newline failed:
	in that case, MB_START was not adjusted and was initially the same
	as BEG, so wordchar_prev mistakenly returned 0.
	* src/kwsearch.c (Fexecute): Set MB_START also when there is no
	preceding newline.
	* NEWS (Bug fixes): Mention it.
	* tests/mb-non-UTF8-word-boundary: New file. Test for the bug.
	* tests/Makefile.am (TESTS): Add it.
	Reported by NIDE, Naoyuki in https://bugs.gnu.org/38223.

2019-11-08  Jim Meyering  <meyering@fb.com>

	build: update gnulib to latest
	* po/POTFILES.in: Add lib/argmatch.h.

2019-11-05  Paul Eggert  <eggert@cs.ucla.edu>

	grep: new --no-ignore-case option
	Suggested by Karl Berry and mostly implemented by Arnold Robbins
	(Bug#37907).
	* NEWS:
	* doc/grep.in.1:
	* doc/grep.texi (Matching Control):
	* src/grep.c (usage):
	Document the new option.
	* src/grep.c (NO_IGNORE_CASE_OPTION): New constant.
	(long_options, main): Support new option.

	grep: simplify previous patch
	* src/grep.c (main): Use an int rather than an enum for a local
	var, which is overkill here.

	grep: further simplify out_file handling
	* src/grep.c (print_filenames): Make this a local variable instead
	of static.  Rename it to filename_option, to avoid confusion with
	the print_filename function, and rename the enum values for the
	same reason.  All uses changed.
	(out_file): Now -1, 0, 1 to represent unknown, false, true.
	All uses changed.
	(single_command_line_arg): Remove.  This static variable’s
	function is now accomplished by a local variable ‘num_operands’.
	(grepdesc): Simplify adjustment of out_file accordingly.
	(main): Initialize out_file to -1 if not known yet.

2019-11-05  Zev Weiss  <zev@bewilderbeest.net>

	grep: simplify out_file handling
	* src/grep.c (print_filenames): New tristate enum (-H, -h, or
	neither); supplants with_filenames and no_filenames.
	(single_command_line_arg): New variable indicating if grep was run
	with a single command-line argument.
	(no_filenames): Remove variable.
	(grepdirent): Don't twiddle out_file back and forth during recursion.
	(grepdesc): Turn off out_file on 'grep -r foo nondirectory'.
	(main): Replace with_filenames and no_filenames with print_filenames.
	Enable out_file when both -r/-R and multiple arguments are given.

2019-10-12  Paul Eggert  <eggert@cs.ucla.edu>

	grep: fix ‘grep -L ... >/dev/null’ bug
	Problem reported by Adam Sampson (Bug#37716).
	* NEWS: Mention this.
	* src/grep.c (grepdesc): Don’t assume that stdout being /dev/null
	means list_files == LISTFILES_NONE.
	(main): Do not change list_files merely because stdout is /dev/null.
	* tests/skip-read: Test for this bug.

2019-10-03  Paul Eggert  <eggert@cs.ucla.edu>

	grep: tighten -i doc
	* doc/grep.in.1:
	* doc/grep.texi (Matching Control):
	* src/grep.c (usage):
	Make it clearer that -i affects patterns and data, but not
	file names (Bug#37604).

2019-03-10  Paul Eggert  <eggert@cs.ucla.edu>

	maint: fix “/src/grep: No such file or directory”
	Problem reported by Jim Meyering in:
	https://lists.gnu.org/r/grep-devel/2019-02/msg00000.html
	* NEWS: Mention the change.
	* configure.ac (fn_grep): Remove.  This old attempt to fix
	<https://savannah.gnu.org/bugs/?31646> wasn’t working anyway,
	since subprograms didn’t grok fn_grep.  People building on Solaris
	will need a working grep, which is reasonably standard nowadays.
	(GREP, EGREP): Do not override.  This way, we test the
	newly-built grep only when running ‘make test’ and suchlike.
	Instead, output a hopefully-helpful diagnostic if the
	system 'grep' does not work.

2019-02-18  Jim Meyering  <meyering@fb.com>

	tests: avoid false positive upon stack overflow
	* tests/pcre-jitstack: Don't let a stack overflow evoke a false
	failure.  This test is to ensure there is no internal PCRE error.
	Reported by Andreas Schwab in http://bugs.gnu.org/34370

2019-02-16  Jim Meyering  <meyering@fb.com>

	build: avoid build failure with --enable-gcc-warnings
	* src/kwset.c (bmexec_trans): Define with _GL_ATTRIBUTE_PURE,
	per suggestion from recent gcc snapshot.

2019-02-03  Paul Eggert  <eggert@cs.ucla.edu>

	doc: clarify --exclude globbing
	Problem reported by Paul Jackson.
	* doc/grep.in.1:
	* doc/grep.texi (File and Directory Selection):
	Clarify how --exclude globbing works.

	grep: parse --color arg independent of locale
	This is a better fix for Bug#34285.
	* bootstrap.conf (gnulib_modules): Add c-strcase.
	* src/grep.c: Include c-strcase.h, not strings.h.
	(main): Use c_strcasecmp, not strcasecmp.

2019-02-02  Paul Eggert  <eggert@cs.ucla.edu>

	grep: fix grep.c includes
	* src/grep.c: Include strings.h; problem reported by David
	Monniaux (Bug#34285).  Do not include fcntl.h, as system.h does
	that for us.h

	build: update gnulib submodule to latest

2019-01-20  Jim Meyering  <meyering@fb.com>

	build: ensure no VLA is used
	Cause developer builds to fail for any use of a VLA.
	VLAs (variable length arrays) limit portability.
	* configure.ac (nw): Remove -Wvla from the list of disabled warnings,
	thus enabling the warning when configured with --enable-gcc-warnings.
	(GNULIB_NO_VLA) Define, disabling use of VLAs in gnulib.  This commit
	is functionally equivalent to coreutils' v8.30-44-gd26dece5d.

	build: update gnulib to latest

2019-01-20  Paul Eggert  <eggert@cs.ucla.edu>

	doc: --binary-files update in man page
	* doc/grep.in.1: Adjust --binary-files description to match that
	in doc/grep.texi.  When I updated the documentation in
	2016-09-09T01:33:14!eggert@cs.ucla.edu I forgot to update the man
	page accordingly (Bug#33898).

	grep: simplify pcresearch.c ifdefs
	This fixes a warning if PCRE is not used (Bug#34054).
	* configure.ac (USE_PCRE): New conditional.
	* src/Makefile.am (grep_SOURCES) [!USE_PCRE]: Omit pcresearch.c.
	* src/grep.c (matchers) [!HAVE_LIBPCRE]: Omit perl matcher.
	(setmatcher) [!HAVE_LIBPCRE]: If helpful, mention
	--disable-perl-regexp in diagnostic.
	* src/pcresearch.c: Simplify by assuming HAVE_LIBPCRE.

2019-01-01  Jim Meyering  <meyering@fb.com>

	maint: update all copyright dates via "make update-copyright"
	* gnulib: Also update submodule for its copyright updates.

2018-12-20  Jim Meyering  <meyering@fb.com>

	doc: fix the bug-introduced version in 3.3's announcement
	* NEWS: Correct bug-introduced version (s/2.3/3.2/).
	* cfg.mk (old_NEWS_hash): Updating old news, we must also udpate this.

	maint: post-release administrivia
	* NEWS: Add header line for next release.
	* .prev-version: Record previous version.
	* cfg.mk (old_NEWS_hash): Auto-update.

	version 3.3
	* NEWS: Record release date.

	grep: fix \b DFA-bug in C locale
	Under some conditions, \b would mistakenly fail to match, e.g.
	  echo 123-x|LC_ALL=C grep '.\bx'
	* NEWS (Bug fixes): Mention it
	* gnulib: Update to latest, for DFA regression fix.
	* tests/word-delim-multibyte: Add a test for the dfa.c regression.

2018-12-20  Paul Eggert  <eggert@cs.ucla.edu>

	grep: fit --version authorship into 80
	* src/grep.c (AUTHORS): Remove.
	(main): Output the authorship info ourselves instead of having
	version_etc do it.  This is better for i18n anyway.

	build: update gnulib submodule to latest

2018-12-20  Jim Meyering  <meyering@fb.com>

	maint: post-release administrivia
	* NEWS: Add header line for next release.
	* .prev-version: Record previous version.
	* cfg.mk (old_NEWS_hash): Auto-update.

	version 3.2
	* NEWS: Record release date.

2018-12-18  Jim Meyering  <meyering@fb.com>

	build: update gnulib for c-stack fix

2018-12-17  Bruno Haible  <bruno@clisp.org>

	tests: stack-overflow: avoid unwarranted test failure on some hosts
	* tests/stack-overflow: Use ulimit to limit stack size. Otherwise,
	at least on gcc113, grep would fail to overflow its stack, so this
	test would fail to find the required diagnostic and would fail.

2018-12-16  Jim Meyering  <meyering@fb.com>

	tests: reenable the surrogate-pair test
	This reverts commit bdb98cec2e7bf255e1d00eaf8be16299f7bf571e,
	but adding the comment changes suggested by Bruno Haible in
	https://lists.gnu.org/r/grep-devel/2018-12/msg00037.html
	* tests/surrogate-pair: New file.
	* tests/Makefile.am (TESTS): List it.

2018-12-16  Bruno Haible  <bruno@clisp.org>

	tests: stackoverflow: fix test failure on HardenedBSD 11
	* tests/stack-overflow: Try up to 10 million opening parentheses.

2018-12-16  Jim Meyering  <meyering@fb.com>

	tests: remove stale surrogate-pair test
	The cygwin-specific code for surrogate pairs was first disconnected
	via v2.21-62-g936c904 and later removed as part of a then-unused
	function via v2.24-12-g704de87. So now I'm removing the test, too.
	If someone thinks it important and would like to revive it, please do.
	* tests/surrogate-pair: Remove file.
	* tests/Makefile.am (TESTS): Remove it.

2018-12-16  Paul Eggert  <eggert@cs.ucla.edu>

	build: update gnulib submodule to latest

2018-12-15  Jim Meyering  <meyering@fb.com>

	tests: stack-overflow: handle the case of success without the diagnostic
	* tests/stack-overflow: Do not always require a stack
	overflow diagnostic.

	build: update gnulib to latest
	* gnulib: Update to latest, to pull in code that now compensates for
	a bug in glibc-2.27 and prior.

	build: make the autoconf-2.63 requirement explicit
	* configure.ac: AC_PREREQ: Require 2.63, not 2.59. And quote properly.
	Autoconf-2.63 has been required for some time via gnulib.
	This merely makes it explicit.

2018-12-15  Paul Eggert  <eggert@cs.ucla.edu>

	tests: fix diagnostic typo
	Fix by Bruno Haible in:
	https://lists.gnu.org/r/grep-devel/2018-12/msg00003.html
	* tests/init.cfg (envvar_check_fail): Fix diagnostic.

2018-11-24  Jim Meyering  <meyering@fb.com>

	tests: stack-overflow: avoid false failure
	* tests/stack-overflow: This test would fail to elicit a stack overflow
	diagnostic on some OS X systems. Rewrite to iterate, gradually increasing
	the size of the input regex, stopping when grep emits the desired diagnostic
	or the size reaches a reasonable limit.

2018-10-16  Jim Meyering  <meyering@fb.com>

	tests: reduce the sole failing test
	* tests/backref-alt: Significantly reduce abort-inducing input.

	build: update gnulib to latest; also update bootstrap and init.sh

2018-10-13  Jim Meyering  <meyering@fb.com>

	doc: NEWS: mention performance improvements
	* NEWS (Improvements): Mention them.

2018-10-13  Jim Meyering  <meyering@fb.com>

	grep: triple initial buffer size: 32k->96k
	Changing 32k to 96k gives a 3-23% performance improvement.
	All timings ran with this diff on top of commit v3.1-39-g7179b21:

	for n in 32 64 96 128; do
	  echo n=$n
	  perl -pi -e 's/(INITIAL_BUFSIZE =) \d+/$1 '$n/ src/grep.c &&
	    make AM_CFLAGS=-O3 WERROR_CFLAGS= >& makerr-$n &&
	    for needle in 1f2 1f298lkjskjhahjklkj34; do
	      echo "  needle=$needle"
	      for i in $(seq 10); do
	         env MALLOC_PERTURB_= time -qf%e src/grep $needle w2000
	      done 2>&1 |sort -g | tee >(head -1|sed 's/^/    /') > .time-${n}KB-$needle
	    done
	done

	Tested searchs: search for a short literal pattern that is not
	present in 9.3GB file containing 2000 copies of /usr/dict/words
	created via this:
	  ln -s /usr/share/dict/words k && cat $(yes k|head -2000) > w2000
	I ran this command:
	  env MALLOC_PERTURB_= time src/grep 1f2 w2000
	old(32k) vs new elapsed time, best of 10 trials (gcc-9.0.0 20180831, -O3):
	 32k  64k  96k(%incr) 128k CPU
	1.25 1.18 1.16( 7.2) 1.20 i7-4770S@3.10GHz cache=8MB
	1.21 1.16 1.17( 3.3) 1.19 Xeon(R) E3-1505M v5 @ 2.80GHz cache=8MB
	2.36 2.29 2.29( 3.0) 2.36 Xeon(R) E5-2680 v4 @ 2.40GHz cache=32MB
	1.40 1.32 1.31( 6.4) 1.33 i5-6260U @ 1.80GHz cache=4MB
	1.31 1.26 1.24( 5.3) 1.23 AMD FX(tm)-4100 cache=2MB (with only 1000 copies)

	Searching for a longer string: 1f298lkjskjhahjklkj34
	2.03 1.76 1.61(20.7) 1.53 i7-4770S@3.10GHz cache=8MB
	1.95 1.70 1.56(20.0) 1.51 Xeon(R) E3-1505M v5 @ 2.80GHz
	3.27 2.98 2.84(13.1) 3.02 Xeon(R) E5-2680 v4 @ 2.40GHz
	2.48 2.12 1.91(23.0) 1.80 i5-6260U @ 1.80GHz cache=4MB
	1.72 1.54 1.46(15.1) 1.41 AMD FX(tm)-4100 cache=2MB

	* src/grep.c (INITIAL_BUFSIZE): Triple it: 32kB -> 96kB

2018-09-28  Barret Rhoden  <brho@cs.berkeley.edu>  (tiny change)

	maint: fix cross-compiling problem
	* cfg.mk (PATH): Omit if cross-compiling (Bug#32866).

2018-09-28  Paul Eggert  <eggert@cs.ucla.edu>

	build: update gnulib submodule to latest

	grep: fix usage 80-column glitch
	* src/grep.c (usage): Do not go over 80 columns in the source
	code, to pacify "make dist".

2018-09-19  Paul Eggert  <eggert@cs.ucla.edu>

	maint: update bootstrap
	* bootstrap: Copy from Gnulib.

	maint: fix build failure
	Problem found by OpenCSW buildbot; the bug also occurs on GNU/Linux
	build platforms.  The symptom is “system.h:26:24: fatal error:
	configmake.h: No such file or directory”.  See:
	https://buildfarm.opencsw.org/buildbot/builders/ggrep-solaris10-sparc/builds/107
	* bootstrap.conf: Add configmake, a dependency that was formerly brought
	in only by accident.

2018-09-18  Paul Eggert  <eggert@cs.ucla.edu>

	build: update gnulib submodule to latest

2018-08-09  Paul Eggert  <eggert@cs.ucla.edu>

	tests: fix comment

	tests: backref-alt works with glibc 2.28
	Problem reported by Jaroslav Skarvada (Bug#32409).
	* tests/Makefile.am (XFAIL_TESTS) [!USE_INCLUDED_REGEX]:
	Don’t add backref-alt, since this bug is fixed in glibc 2.28.

2018-05-11  Paul Eggert  <eggert@cs.ucla.edu>

	doc: “pattern” vs “patterns”
	* doc/grep.in.1, doc/grep.texi, src/grep.c (usage): Be more
	careful about saying that an argument or option specifies one or
	more patterns, not just a single pattern.  Problem reported by Kaz
	Kylheku (Bug#31400).

	build: update gnulib submodule to latest

2018-04-21  Jim Meyering  <meyering@fb.com>

	maint: fix new syntax-check (sc_long_lines) failure
	* HACKING: Shorten line by one byte to fit in 80 columns.

	build: update gnulib to latest

2018-04-21  Paul Eggert  <eggert@cs.ucla.edu>

	doc: fix font typo

	maint: update URLs
	Mostly this is just changing http: to https:.
	In one or two places it removes no-longer-useful URLs.

	doc: man-page format fixes
	* doc/grep.in.1: Fix minor formatting glitches, e.g., extra
	space after [...] because groff thought it was a sentence end.
	Problem reported by Ingo Schwarze (Bug#31228#11).

2018-04-20  Paul Eggert  <eggert@cs.ucla.edu>

	doc: mention encoding errors
	This attempts to document the encoding-error problem more
	precisely (Bug#30326).
	* doc/grep.in.1, doc/grep.texi: Mention that the behavior of
	patterns like ‘.’ is not specified on encoding errors.

	doc: port better to mandoc
	* doc/grep.in.1: Check for groff and its macro packages
	independently, as groff can be used with non-groff macro packages.
	Use an-ext style macros rather than www.tmac style, as this should
	be more portable to mandoc.  Problem reported by Laura Morales and
	Ingo Schwarze (Bug#31228).

2018-02-16  Jim Meyering  <meyering@fb.com>

	maint: avoid new syntax-check failure
	* cfg.mk (old_NEWS_hash): Update, to accommodate v3.1-20-g63d4174's
	typo fix.

	doc: clarify that PCRE support is here to stay
	* doc/grep.texi (grep Programs): Clarify: it's not PCRE support
	that is experimental, but its combination with --null-data (-z).

2018-02-05  Paul Eggert  <eggert@cs.ucla.edu>

	maint: fix typo

2018-01-06  Jim Meyering  <meyering@fb.com>

	maint: update gnulib and copyright dates for 2018
	* gnulib: Update to latest.
	* all files: Run "make update-copyright".
	* bootstrap: Update from gnulib.

2017-12-17  Jim Meyering  <meyering@fb.com>

	build: link with -lsigsegv, when c-stack module requires it
	* src/Makefile.am (grep_LDADD): Add $(LIBCSTACK).
	Otherwise, on at least Debian and Arch-based systems, linking would
	fail with diagnostics like these:
	  c-stack.c:207: undefined reference to `stackoverflow_install_handler'
	  c-stack.c:216: undefined reference to `sigsegv_install_handler'
	Reported by Jeremy Feusi.

	build: suppress sig-handler.h's -Wcast-function-type warning
	* configure.ac (WERROR_CFLAGS): Add -Wno-cast-function-type
	to suppress warning about sig-handler.h's sa_handler_t cast:
	sig-handler.h: In function 'get_handler':
	sig-handler.h:47:12: error: cast between incompatible function\
	  types from 'void (* const)(int,  siginfo_t *, void *)'\
	  {aka 'void (* const)(int,  struct <anonymous> *, void *)'}\
	  to 'void (*)(int)' [-Werror=cast-function-type]
	     return (sa_handler_t) a->sa_sigaction;

2017-12-16  Jim Meyering  <meyering@fb.com>

	grep: diagnose stack overflow rather than segfaulting
	* bootstrap.conf (gnulib_modules): Add c-stack.
	* src/grep.c: Include "c-stack.h".
	(main): Call c_stack_action (NULL);
	* tests/stack-overflow: New file.
	* tests/Makefile.am (TESTS): Add name of new file.
	* NEWS (Improvements): Mention it.
	Interestingly, this bug does not afflict grep-2.5.4 or prior,
	so it appeared to have been introduced with grep-2.6.  However,
	the origin is in glibc's regexp compiler, and I tracked it to
	stack-aware parsing that was removed from glibc's regexp in 2002.
	However, grep-2.5.4 was released in 2009.  That version worked
	(and still works, now) because it included and (by default) used
	an old copy of glibc's regexp code.
	Jeremy Feusi reported the grep segfault in https://bugs.gnu.org/29666.
	I reported the glibc regexp bug in
	https://sourceware.org/bugzilla/show_bug.cgi?id=22620

2017-11-26  Stephan T. Lavavej  <stl@nuwen.net>

	grep: fix directory recursion on MS-Windows
	gnulib recently gained a module, windows-stat-inodes, that fixes
	directory recursion on MS-Windows. No changes to grep's C sources are
	required; grep simply needs to request the module during configuration.

	When grep requests this module, its configure script will gain the
	behavior that was implemented in windows-stat-inodes.m4. This detects
	mingw and sets WINDOWS_STAT_INODES=1. All other platforms are
	unaffected, setting WINDOWS_STAT_INODES=0 (which is what's happening
	in the absence of this patch).

	* bootstrap.conf (gnulib_modules): Add windows-stat-inodes.
	* NEWS (Bug fixes): Mention it.
	Thanks to Pär Björklund who diagnosed the problem as involving inodes,
	and thanks to Václav Haisman who provided the bootstrap.conf patch.

2017-11-25  Paul Eggert  <eggert@cs.ucla.edu>

	grep: port better to Adélie GNU/Linux 64-bit ppc
	Problem reported by A. Wilcox (Bug#29446).
	* src/pcresearch.c (PCRE_EXTRA_MATCH_LIMIT_RECURSION)
	(PCRE_STUDY_EXTRA_NEEDED): Default to 0.
	(jit_exec): If we run up against the recursion limit,
	double it (if possible) and try again.
	(Pcompile): Also specify PCRE_STUDY_EXTRA_NEEDED so that
	pc->extra is not null.

2017-11-03  Paul Eggert  <eggert@cs.ucla.edu>

	grep: omit a dup 'const'
	* src/grep.c (matchers): Omit duplicate 'const'.

2017-10-13  Bernhard Voelker  <mail@bernhard-voelker.de>

	doc: document the option delimiter '--'
	* doc/grep.texi (Other options): Do the above.
	Reported in https://lists.opensuse.org/opensuse/2017-03/msg00411.html
	This addresses http://bugs.gnu.org/26139

2017-08-21  Paul Eggert  <eggert@cs.ucla.edu>

	build: update gnulib submodule to latest

	Pacify GCC 5.4
	* src/grep.c (grepdesc): Rework to pacify GCC 5.4 warning
	about logical not.

2017-08-20  Paul Eggert  <eggert@cs.ucla.edu>

	build: update gnulib submodule to latest

2017-08-17  Paul Eggert  <eggert@cs.ucla.edu>

	grep: -L exits with status 0 if a file is selected
	Problem reported by Anthony Sottile (Bug#28105).
	* NEWS, doc/grep.texi (Exit Status), src/grep.c (usage): Document this.
	* src/grep.c (grepdesc): Implement it.
	* tests/skip-read: Test it.

	build: update gnulib submodule to latest

2017-08-13  Jim Meyering  <meyering@fb.com>

	maint: avoid newly-introduced syntax-check failure
	* src/grep.c (usage): Shorten --help line to 80, so
	"make syntax-check" passes once again.

2017-08-03  Paul Eggert  <eggert@cs.ucla.edu>

	doc: improve -o help
	* src/grep.c (usage): Document that -o outputs only nonempty
	matches (Bug#27931).

2017-07-26  Paul Eggert  <eggert@cs.ucla.edu>

	tests: add Bug#27838 test case
	* tests/backref-alt: New test case from a fuzzer.

2017-07-25  Paul Eggert  <eggert@cs.ucla.edu>

	doc: distinguish -w from \<...\>
	* doc/grep.texi (Matching Control):
	Give example of why -w differs from \<...\> (Bug#27813).

2017-07-11  Paul Eggert  <eggert@cs.ucla.edu>

	doc: define Dt string in man page
	Problem reported by Bjarni I. Gislason via Santiago R.R. (Bug#27651).
	* doc/grep.in.1 (dT): New macro.
	(Dt): Define this string.

2017-07-02  Jim Meyering  <meyering@fb.com>

	maint: post-release administrivia
	* NEWS: Add header line for next release.
	* .prev-version: Record previous version.
	* cfg.mk (old_NEWS_hash): Auto-update.

	version 3.1
	* NEWS: Record release date.

2017-07-01  Jim Meyering  <meyering@fb.com>

	tests: avoid false failures when run in qemu user mode
	* tests/filename-lineno.pl: Derive the program name that grep
	will use in diagnostics, based on a suggestion from Assaf Gordon.
	* tests/in-eq-out-infloop: Similar: accept an arbitrary "command_name: "
	prefix on checked diagnostics, rather than requiring "grep: ".
	* tests/reversed-range-endpoints: Likewise.
	* tests/write-error-msg: Likewise.
	Reported by Bruno Haible in http://bugs.gnu.org/27532

2017-06-25  Jim Meyering  <meyering@fb.com>

	gnulib: update to latest
	* gnulib: Update to latest for these portability fixes:
	- stat: port to xlc 12.01
	- xalloc-oversized: port to icc

	doc: fix another typo
	* doc/grep.texi (File and Directory Selection): Fix typo: s/afer/after/

2017-06-24  Jim Meyering  <meyering@fb.com>

	doc: stop calling --perl-regexp (-P) "highly" experimental
	Use wording that is less likely to make readers think that
	support for -P may be removed.
	* doc/grep.in.1: s/highly experimental/experimental/
	* doc/grep.texi: Likewise.
	Suggested by Evan Sheahan.

2017-06-21  Jim Meyering  <meyering@fb.com>

	doc: correct typo
	* doc/grep.texi (Performance): s/suprisingly/surprisingly/

	gnulib: update to latest

2017-06-21  Paul Eggert  <eggert@cs.ucla.edu>

	grep: -m no longer cuts off trailing context
	Problem reported by Markus Jochim (Bug#26254).
	* NEWS, doc/grep.texi (General Output Control): Document this.
	* src/grep.c (prpending): Selected lines no longer cut off context.
	(usage): Say "selected" instead of "matching", where appropriate.
	* tests/foad1, tests/max-count-vs-context, tests/yesno:
	Adjust to match new behavior.

2017-05-31  Paul Eggert  <eggert@cs.ucla.edu>

	Document grep performance
	* doc/grep.texi (Performance): New section.

	build: update gnulib submodule to latest

2017-05-21  Jim Meyering  <meyering@fb.com>

	maint: make the announcement template Cc the devel- list
	* cfg.mk (announcement_Cc_): Define.

	gnulib: update to latest; and update tests/init.sh

	maint: accommodate GCC7's -Werror=duplicated-branches
	* src/system.h (IGNORE_DUPLICATE_BRANCH_WARNING): Define.
	* src/grep.c (grepfile): Use it.
	* src/kwset.c (bmexec, acexec): Use it.

	maint: update to work with GCC7's -Werror=implicit-fallthrough=
	* src/system.h (FALLTHROUGH): Define.
	* src/grep.c (context_length_arg): Use new FALLTHROUGH macro in place
	of comments
	(fgrep_to_grep_pattern, try_fgrep_pattern, main): Likewise.

2017-05-13  Jim Meyering  <meyering@fb.com>

	gnulib: update to latest and adapt src/kwset.c
	* gnulib: Update to latest.
	* src/kwset.c: Include "verify.h" for use of assume.

2017-03-22  Jim Meyering  <meyering@fb.com>

	gnulib: update to latest for dfa [0-9] performance improvement
	This pulls in the following change that is very relevant to grep:

	    commit 6afba02d7869d39ed7f61981045ddbdcb2814101
	    Author: Paul Eggert <eggert@cs.ucla.edu>
	    dfa: make [0-9] faster in non-C locales

	* gnulib: Update to latest.
	* NEWS (Improvements): Describe the effect on grep.

2017-03-05  Jim Meyering  <meyering@fb.com>

	build: use $(builddir), not $(srcdir)
	* cfg.mk (PATH): Use $(builddir), so this also takes effect
	in a non-srcdir build.  Also, switch ${PATH} syntax to $(PATH).

2017-03-05  Juan Manuel Guerrero  <juan.guerrero@gmx.de>

	build: use $(PATH_SEPARATOR), not ":" to augment PATH
	* cfg.mk (PATH): Use $(PATH_SEPARATOR), for those systems that
	use something other than ":".
	* THANKS.in: Remove name, to avoid syntax-check failure due to
	the duplicate, now that there is this commit.

2017-02-17  Jim Meyering  <meyering@fb.com>

	maint: fix distcheck failure: remove stale dosbuf.c reference
	* src/Makefile.am (EXTRA_DIST): Do not attempt to distribute
	the recently deleted file, dosbuf.c.

	maint: fix new syntax-check errors
	* po/POTFILES.in: Add lib/xbinary-io.c.
	* cfg.mk (FILTER_LONG_LINES): Add TODO to the list of exempt files.

2017-02-16  Paul Eggert  <eggert@cs.ucla.edu>

	Fix up recent -U patches
	Inspired by a suggestion by Eric Blake (Bug#25707#17).
	* bootstrap.conf (gnulib_modules): Add xbinary-io,
	and remove binary-io and xfreopen.
	* doc/grep.texi (Other Options):
	Fix typo and reword to be a bit more general.
	* src/grep.c: Include xbinary-io.h instead of xfreopen.h.
	(grepfile): Open with O_BINARY if binary.
	(grepdesc): No need for set_binary_mode now.
