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

	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.
	(grep_command_line_arg, main): Set stdin to binary mode if binary.
	(main): Avoid unnecessary test of stdin == NULL.
	Use xsetmode instead of xfreopen.
	* src/system.h: Do not include binary-io.h.

	build: update gnulib submodule to latest

	Simplify -U on MS-Windows by removing guesswork
	Suggested by Eric Blake (Bug#25707#11).
	* NEWS, doc/grep.texi: Document this.
	* src/dosbuf.c: Remove.
	* bootstrap.conf (gnulib_modules): Add xfreopen.
	* src/grep.c: Include xfreopen.h, not dosbuf.c.
	(fillbuf, print_line_head): Do not undossify input.
	(binary): New static var.
	(grepdesc): Apply BINARY to input file.
	(usage): Remove -u help.
	(main): Set BINARY if -U, and apply it to stdout.  Do nothing if -u.
	With -f, apply BINARY to input file.

2017-02-16  Eric Blake  <eblake@redhat.com>

	grep: don't forcefully strip carriage returns
	Commit 5c92a54 made the mistaken assumption that using fopen("rt")
	on platforms where O_TEXT is non-zero makes sense.  However, POSIX
	already requires fopen("r") to open a file in text mode, vs.
	fopen("rb") when binary mode is wanted, and at least on Cygwin,
	where it is possible to control whether a mount point is binary
	or text by default (using just "r"), the use of fopen("rt") actively
	breaks assumptions on a binary mount by silently corrupting any
	carriage returns that are supposed to be preserved.

	* src/grep.c (main): Never use fopen("rt") (Bug#25707).

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

	Update TODO and doc
	* TODO: Bring up-to-date and fix formatting glitches.
	* doc/grep.in.1, doc/grep.texi: Fix minor glitches.
	The above patches should address the same problems that recent
	Debian doc patches address, albeit in a different way.

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

	doc: clarify default input (Bug#25651)
	* doc/grep.in.1:
	* src/grep.c (usage): Clarify default input when -r.
	* src/grep.c (usage): Do not bother documenting egrep and fgrep;
	the manual is enough.

2017-02-09  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.0
	* NEWS: Record release date.

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

	grep: do not mishandle \. in multiple patterns
	Problem reported by Lars Wendler (Bug#25655).
	* NEWS: Document this.
	* src/grep.c (try_fgrep_pattern): Fix typo that prevented
	keys from being properly updated.
	* tests/foad1: Test for the bug.

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

	Do not assume PCRE 8.20 or later
	Problem reported by Zube (Bug#25647)
	* NEWS: Document this.
	* src/pcresearch.c (struct pcre.com.jit_stack):
	Declare only if PCRE_STUDY_JIT_COMPILE.

2017-02-06  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 2.28
	* NEWS: Record release date.

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

	gnulib: update to latest

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

	grep: tune to avoid memchr2 sometimes
	Problem noted by Norihiro Tanaka in:
	http://lists.gnu.org/archive/html/grep-devel/2017-01/msg00027.html
	Although not enough to restore all the previous performance in the
	case he noted, it helps significantly.
	* src/kwset.c (memchr_kwset): Bring back small_heuristic,
	in a somewhat different form.

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

	gnulib: update to latest

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

	grep: simplify recent kwset change
	* src/kwset.c (acexec_trans): Simplify.

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

	tests: really add the new test name
	* tests/Makefile.am (TESTS): Add fgrep-longest.

2017-01-21  Norihiro Tanaka  <noritnk@kcn.ne.jp>

	grep -Fo could report a match that is not the longest
	* src/kwset.c (acexec): Fix it.
	* tests/fgrep-longest: New test.
	* tests/Makefile.am: Add the test.
	* NEWS: Mention it.

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

	grep: speed up Aho-Corasick when at most 2 bytes
	When using Aho-Corasick and all matched strings either begin with
	the same byte, or begin with one of at most two bytes, use memchr2
	to search for these matching bytes and apply the Aho-Corasick
	algorithm only when a memchr2 match is found.  On my platform,
	this speeds up 'grep -F -e aa -e ba in' by a factor of 7, where
	the file 'in' was created by 'seq -f %040.0f 10000000 >in'.
	* src/kwset.c (struct kwset.gc1): Now int, not char.
	If negative, there is no single terminal byte.  All uses changed.
	(struct kwset.gc1help): Now int, not char.
	If negative, memchr2 cannot be used.
	(kwsprep): Set up gc1 and gc1help from kwset->next, with
	the new (slightly changed) interpretation.
	(memchr_kwset): Use memchr2 if possible.
	Adjust to match new meaning of gc1, gc1help.
	(memoff2_kwset): Remove; no longer needed.
	(acexec_trans): Use memchr_kwset when possible, for speed.
	It now supersedes memoff2_kwset.

	grep: remove Commentz-Walter code
	This code was not being used, and complicated maintenance.
	We can bring it back from the repository if it turns out
	to be useful later.
	* src/kwset.c (struct kwset.reverse): Remove.  All uses of
	FOO->reverse replaced by (FOO->kwsexec == bmexec).
	(kwsalloc): Remove 'reverse' arg, as callers outside this
	module do not care about algorithm choice.  All callers changed.
	(kwsprep): When deciding whether to use Boyer-Moore, do not worry
	about being called twice on the same kwset, as that is not allowed.
	(cwexec): Remove; it was never called.  All uses removed.

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

	maint: avoid new syntax-check failures
	* src/kwset.c (struct kwset): Split a line longer than 80.
	* bootstrap: Update from gnulib. This fixes a new syntax-check
	failure due to its use of "time stamp".

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

	* NEWS: Fix typo.

	* src/kwset.c: Fix comment typo.

	Improve -i performance in typical UTF-8 searches
	Currently ‘grep -i i’ is slow in a UTF-8 locale, because ‘i’ in
	the pattern matches the two-byte character 'ı' (U+0131, LATIN
	SMALL LETTER DOTLESS I) in data, and kwset handles only
	single-byte character translations, so grep falls back on a slower
	DFA-based search for all searches.  Improve -i performance in the
	typical case by using kwset when data are free of troublesome
	characters like 'ı', falling back on the DFA only when data
	contain troublesome characters.
	* src/dfasearch.c (GEAcompile):
	* src/grep.c (compile_fp_t):
	* src/kwsearch.c (Fcompile):
	* src/pcresearch.c (Pcompile):
	Pattern arg is now char *, not char const *, since Fcompile
	now reallocates it sometimes.
	* src/grep.c (all_single_byte_after_folding): Remove.
	All callers removed.
	(fgrep_icase_charlen): New function.
	(fgrep_icase_available, try_fgrep_pattern):
	Use it, for more-generous semantics.
	(fgrep_to_grep_pattern): Now extern.
	(main): Do not free keys, since Fexecute may use them.
	* src/kwsearch.c (struct kwsearch): New struct.
	(Fcompile): Return it.  If -i, be more generous about patterns.
	(Fexecute): Use it.  Fall back on DFA when the data contain
	troublesome characters; this should be rare in practice.
	* src/kwset.c, src/kwset.h (kwswords): New function.

	build: update gnulib submodule to latest

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

	dfa: prefer ptrdiff_t to size_t
	The code already cannot handle objects with size greater than
	SIZE_MAX / 2, so be more honest about it and use ptrdiff_t instead
	of size_t.  ptrdiff_t arithmetic is signed, which allows for more
	checking via -fsanitize=undefined.  It also makes the code a tad
	smaller on x86-64, since it can test for < 0 rather than for ==
	SIZE_MAX.
	* src/dfasearch.c (struct dfa_comp.kwset_exact_matches):
	(kwsmusts, EGexecute):
	* src/kwsearch.c (Fcompile, Fexecute):
	* src/kwset.c (struct kwset.kwsexec, kwsincr, memchr_kwset)
	(memoff2_kwset, bmexec_trans, bmexec, cwexec, acexec_trans)
	(acexec, kwsexec):
	* src/kwset.h (struct kwsmatch.index, .offset, .size):
	Prefer ptrdiff_t to size_t where either will do.

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

	grep: improve comments, mostly in kwset
	Remove kwset.h comments that are obsolete and seemingly not
	maintained anyway; people can look in kwset.c instead.
	Update comments to reflect current behavior better.
	Cite Faro & Lecroq 2013.  Use GNU style for end-of-sentence.

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

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

2016-12-31  Paul Eggert  <eggert@cs.ucla.edu>

	grep: speed up -x with many patterns
	* src/kwsearch.c (Fcompile): Improve buffer allocation overhead
	with -x and multiple patterns.  In the common case where '\n' is
	the end-of-line byte, avoid copying other than the first and last
	patterns.

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

	gnulib: update to latest, fixing a parallel getopt test failure

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

	maint: space before paren

	grep: int cleanup in kwset.c
	This should affect only theoretical bugs with very large inputs.
	On my platform, this patch shrinks the grep text by 136 bytes.
	* src/kwset.c: Include intprops.h, for INT_MULTIPLY_WRAPV.
	(struct trie, struct kwset, kwsalloc, kwsincr, treedelta, kwsprep)
	(bm_delta2_search, bmexec_trans, cwexec): Prefer ptrdiff_t to int
	when counts can exceed INT_MAX in large inputs, at least in theory.
	(hasevery): Use bool for booleans.
	(bmexec_trans): Avoid undefined behavior on integer overflow.

2016-12-27  Norihiro Tanaka  <noritnk@kcn.ne.jp>

	grep: improve performance with multiple patterns
	* src/grep.c (main): Avoid fgrep-to-grep conversion for word matching
	with multiple patterns in single byte locales.

2016-12-27  Paul Eggert  <eggert@cs.ucla.edu>

	* NEWS: Fix typo.

	grep: fix bug with '... | grep pat >> /dev/null'
	Problem reported by Benno Fünfstück (Bug#25283).
	* NEWS: Document this.
	* src/grep.c (drain_input) [SPLICE_F_MOVE]:
	Don't assume /dev/null is always acceptable output to splice.
	* tests/grep-dev-null-out: Test for the bug.

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

	grep: minor performance tweak for pure functions
	* src/search.h (wordchars_size, wordchar_next, wordchar_prev):
	Declare to be pure.

2016-12-25  Zev Weiss  <zev@bewilderbeest.net>

	grep: move localeinfo to grep.c
	It's not really dfasearch-specific, and grep.c initializes it, so it
	seems like the most appropriate "owner".

	* src/dfasearch.c (localeinfo): Remove.
	* src/grep.c (localeinfo): Add.
	* src/search.h (localeinfo): Move to new commented section.

2016-12-25  Zev Weiss  <zev@bewilderbeest.net>

	pcresearch: thread safety
	* src/pcresearch.c (pcre_comp): New struct to hold previously-global
	state.
	(jit_exec): Operate on a pcre_comp parameter instead of global state.
	(Pcompile): Allocate and return a pcre_comp instead of setting global
	variables.
	(Pexecute): Operate on a pcre_comp parameter instead of global state.

	kwsearch: thread safety
	* src/kwsearch.c (Fcompile): Return a kwset_t instead of setting a
	global variable.
	(Fexecute): Use a passed-in kwset_t instead of a global variable.
	(kwset): Remove global variable.

	dfasearch: thread safety
	* src/dfasearch.c (struct dfa_comp): New struct to hold
	previously-global variables.
	(dfawarn): Remove static variable.
	(kwsmusts): Operate on a dfa_comp parameter instead of global
	variables.
	(GEAcompile): Allocate and return a dfa_comp struct instead of setting
	global variables.
	(EGexecute): Operate on a dfa_comp parameter instead of global
	variables.
	* src/searchutils.c (kwsinit): Replace a static array with a
	dynamically-allocated one.

2016-12-25  Zev Weiss  <zev@bewilderbeest.net>

	grep: prepare search backends for thread-safety
	To facilitate removing mutable global state from search backends,
	compile() functions will return an opaque pointer to backend-specific
	data, which must then be passed back into the corresponding execute()
	function.  This is merely a preparatory step changing function
	signatures and call sites, so the pointers passed & returned are
	dummies for now and not (yet) actually used.

	* src/grep.c (compile_fp_t): Now returns an opaque pointer (the
	compiled pattern).
	(execute_fp_t): Now passed the pointer returned by a compile_fp_t.
	All call sites updated accordingly.
	(compiled_pattern): New static variable.
	* src/dfasearch.c (GEAcompile): Return a void pointer (dummy NULL).
	(EGexecute): Receive a void pointer argument (unused).
	* src/kwsearch.c (Fcompile): Return a void pointer (dummy NULL).
	(Fexecute): Receive a void pointer argument (unused).
	* src/pcresearch.c (Pcompile): Return a void pointer (dummy NULL).
	(Pexecute): Receive a void pointer argument (unused).
	* src/search.h: Update compile/execute function prototypes.

2016-12-24  Jim Meyering  <meyering@fb.com>

	maint: fix "syntax-check" failure
	* src/grep.c (SEP_STR_GROUP): Declare "static".

2016-12-23  Paul Eggert  <eggert@cs.ucla.edu>

	grep: fix comment in searchutils.c

	grep: improve word checking with UTF-8
	* src/searchutils.c: Do not include <verify.h>.
	(word_start): Remove, replacing with ...
	(sbwordchar): New static var.  All uses changed.
	(wordchar_prev): Return size_t, not bool, as this generates
	slightly better code.  Go back faster if UTF-8.

	grep: standardize on localeinfo.multibyte
	* src/dfasearch.c (EGexecute):
	* src/grep.c (main):
	* src/kwsearch.c (Fexecute):
	* src/pcresearch.c (Pcompile):
	Prefer localeinfo.multibyte to (MB_CUR_MAX > 1).

	grep: speed up -wf in C locale
	Problem reported by Norihiro Tanaka (Bug#22357#100).
	This patch improves the performance on that benchmark on my
	platform so that grep is now only about 2x slower than grep 2.26,
	which means it is considerably faster than grep 2.25 and earlier.
	* src/kwsearch.c (Fexecute):
	Use wordchars_size to boost performance for this case.
	* src/search.h, src/searchutils.c (wordchars_size): New function.

	grep: specialize word-finding functions
	This improves performance a bit.
	* src/dfasearch.c, src/kwsearch.c (wordchar):
	Remove; now in searchutils.c.
	* src/grep.c (main): Call wordinit if -w.
	* src/search.h: Adjust.
	* src/searchutils.c: Include verify.h.
	(word_start): New static var.
	(wordchar): Move here from dfasearch.c and kwsearch.c.
	(wordinit, wordchars_count, wordchar_next, wordchar_prev):
	New functions.
	(mb_prev_wc, mb_next_wc): Remove.
	All callers changed to use the new functions instead.

	grep: simplify Fexecute
	* src/kwsearch.c (Fexecute): Avoid the need for a 'try' local or
	for a 'goto success'.  Update mb_start to reflect newline found.

	grep: remove C label
	* src/kwsearch.c (Fexecute): Remove label.

	maint: rewrite to avoid some macros
	These days, the dangerous powers of C macros are not needed if
	constants or functions will do just as well.
	* src/grep.c (SEP_CHAR_SELECTED, SEP_CHAR_REJECTED, SEP_STR_GROUP)
	(INITIAL_BUFSIZE):
	* src/kwset.c (DEPTH_SIZE):
	Now constants, not macros.
	* src/kwset.c (link): Remove macro. Instead, rename local vars
	from 'link' to 'cur'.
	(malloc) [GREP]: Remove macro.  All uses of malloc changed to xmalloc.
	Omit double-inclusion of xalloc.h.  Do not depend on 'GREP'.
	(U): Now a function, not a macro.
	* src/kwset.c, src/searchutils.c (NCHAR): Move this macro to ...
	* src/system.h: ... here, and make it a constant.

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

	grep: fix performance with multiple patterns
	Problem reported by Jaroslav Skarvada (Bug#22357).
	* NEWS: Document this and other recent performance fixes.
	* src/grep.c (E_MATCHER_INDEX): New constant.
	(all_single_byte_after_folding):
	New function, split out from fgrep_icase_available.
	(fgrep_icase_available): Use it.
	(try_fgrep_pattern): New function, which also uses it.
	(main): With two or more patterns, use try_fgrep_pattern to fix
	performance regression.  The number "two" here is just a heuristic.

	grep: simplify matcher configuration
	* src/grep.c (matcher, compile): Remove static vars.
	(compile_fp_t): Now takes a 3rd syntax argument.
	(Gcomppile, Ecompile, Acompile, GAcompile, PAcompile): Remove.
	(struct matcher): Now nameless, since it is used only once.
	Make 'name' a bit shorter.  New member 'syntax'.
	(matchers): Initialize it, and change removed functions to GEAcompile.
	(F_MATCHER_INDEX, G_MATCHER_INDEX): New constants.
	(setmatcher): New arg MATCHER, and return new matcher index.
	Avoid unnecessary call to strcmp.
	(main): Keep matcher as a local int, not a global pointer.
	* src/kwsearch.c (Fcompile):
	* src/pcresearch.c (Pcompile): Ignore the 3rd syntax argument.

	grep: simplify line counting in patterns
	* src/grep.c (n_patterns): Rename from patfile_lineno,
	as it is now origin-zero.  Now size_t, not uintmax_t.
	(count_nl_bytes, fl_add): Simplify to just buffer and size.
	All callers changed.

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

	build: update gnulib submodule to latest

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

	build: update gnulib submodule to latest

	build: update gnulib submodule to latest

2016-12-13  Jim Meyering  <meyering@fb.com>

	tests: use just-built grep in more places
	* cfg.mk (PATH): Prepend $(srcdir)/src, so that we use the just-
	built grep also when running commands like those of "make distcheck".
	This would have avoided the recently-luckily-noticed infloop bug.
	Tested by running this in a just-built directory:
	f=src/grep; printf '%s\n' '#!/bin/sh' 'sleep 9h' > $f; chmod a+x $f
	and then verifying that nearly every "make syntax-check" rule hangs.

	maint: tell "syntax-check" not to worry about the NEWS update
	Whenever we change "old" NEWS, we have to update this checksum.
	Otherwise, a "make syntax-check" test that guards against a class
	of logical merge conflicts will fail.
	* cfg.mk (old_NEWS_hash): Update this hash to accommodate the
	recent clarification of a 2.27 NEWS entry.

2016-12-13  Arnold D. Robbins  <arnold@skeeve.com>

	build: update gnulib submodule to latest
	* src/dfasearch.c (GEAcompile): Remove use of flag, RE_ICASE covers it.

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

	grep: work around proc lseek glitch
	Problem reported by Andreas Schwab (Bug#25180).
	* NEWS: Document this.
	* src/grep.c (finalize_input): Ignore EINVAL lseek failures.
	* tests/Makefile.am (TESTS): Add proc.
	* tests/proc: New file.

2016-12-07  Paul Eggert  <eggert@cs.ucla.edu>

	grep: simplify finalize_input
	* src/grep.c (finalize_input): Simplify without changing behavior.
	It's still a bit of a rat's-nest, but it's a cozier rat's-nest.

	maint: clarify early-exit news for 2.27
	* NEWS: Mention early-exit options to avoid confusion.  See:
	http://lists.gnu.org/archive/html/grep-devel/2016-12/msg00007.html

2016-12-06  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 2.27
	* NEWS: Record release date.

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

	grep: fix DFA-induced infloop
	* gnulib: Update to latest, for the DFA infloop fix.
	* tests/dfa-infloop: New test, to trigger an infinite loop
	in the DFA matcher.
	* tests/Makefile.am (TESTS): Add it.

2016-11-28  Jim Meyering  <meyering@fb.com>

	tests: use "returns_ N env VAR=val ..."
	rather than "VAR=val returns_ N ..."
	Some shells do not propagate envvar settings through our use
	of the "returns_" function, so set any envvar via use of "env".
	This was an issue at least on Ubuntu and Debian-based systems,
	presumably due to their common use of "dash" as /bin/sh.
	Reported by Assaf Gordon.
	* tests/char-class-multibyte: As above.
	* tests/euc-mb: Likewise.
	* tests/false-match-mb-non-utf8: Likewise.
	* tests/pcre-infloop: Likewise.
	* tests/pcre-jitstack: Likewise.
	* tests/sjis-mb: Likewise.
	* tests/warn-char-classes: Likewise.

2016-11-28  Paul Eggert  <eggert@cs.ucla.edu>

	tests: revert check for unibyte French range bug
	The test wasn't portable, as it assumed that rational ranges
	were not in effect.  Problem reported by Eric Blake (Bug#25048#8).
	There doesn't seem to be a portable way to do the test, so omit it.
	* tests/init.cfg, tests/unibyte-bracket-expr:
	Revert previous change.

	build: update gnulib submodule to latest

2016-11-27  Jim Meyering  <meyering@fb.com>

	grep: avoid false matches in non-UTF8 multibyte locales
	* gnulib: Update to latest, for the dfa.c fix.
	* NEWS (Bug fixes): Mention it.
	* tests/false-match-mb-non-utf8: New file, with tests for this.
	Based on tests from Stephane Chazelas.
	* tests/Makefile.am (TESTS): Add it.
	Introduced by commit v2.18-54-g3ef4c8e, a change that made grep use
	its DFA matcher more aggressively.  The malfunction arises only with
	the DFA matcher, not with regex.
	Reported by Stephane Chazelas in https://bugs.gnu.org/24975

2016-11-20  Paul Eggert  <eggert@cs.ucla.edu>

	tests: check for unibyte French range bug
	Problem reported by Stephane Chazelas (Bug#24973).
	This bug was fixed in Gnulib.
	* NEWS: Document the fix.
	* tests/init.cfg (require_ru_RU_koi8_r): Remove.
	* tests/unibyte-bracket-expr: Add a test for the bug.
	Call get-mb-cur-max directly instead of bothering with
	require_ru_RU_koi8_r.

	build: update gnulib submodule to latest

2016-11-19  Paul Eggert  <eggert@cs.ucla.edu>

	grep: further -P performance fix
	Problem reported by Stephane Chazelas in:
	http://bugs.gnu.org/22655#103
	* src/pcresearch.c (Pexecute): Set the subject to the start of
	each line as it is found.

	grep: -P no longer uses PCRE_MULTILINE
	This reverts commit f6603c4e1e04dbb87a7232c4b44acc6afdf65fef,
	as the extra performance is not worth the trouble for PCRE users.
	Problem reported by Stephane Chazelas in:
	http://bugs.gnu.org/22655#103
	* NEWS: Document this and the next patch.
	* src/dfasearch.c (EGexecute):
	* src/grep.c (execute_fp_t):
	* src/kwsearch.c (Fexecute):
	* src/pcresearch.c (Pexecute):
	First arg is now a const pointer again.
	* src/grep.c (buf_has_encoding_errors): Now static.
	* src/grep.h (buf_has_encoding_errors): Remove decl.
	* src/search.h: Adjust decls.
	* src/pcresearch.c (reflags): Remove.  All uses removed.
	(Pcompile, Pexecute): Do not use PCRE_MULTILINE.

2016-11-19  Jim Meyering  <meyering@fb.com>

	doc: fix a doubled "the"
	* doc/grep.texi (--perl-regexp): s/the\nthe/the/

2016-11-19  Paul Eggert  <eggert@cs.ucla.edu>

	grep: fix -zxP bug
	* NEWS: Document this.
	* src/pcresearch.c (Pcompile): Search a line at a time if -x is
	used, since -x uses ^ and $.
	* tests/pcre: Test this.

	grep: simplify by using PRIuMAX
	* configure.ac (HAVE_PRINTF_C99_SIZES): Remove; no longer needed.
	* src/grep.c (print_offset): Simplify (Bug#24451).

	grep: -T now adjusts number widths for worst case
	* NEWS, doc/grep.texi (Output Line Prefix Control):
	Document this (Bug#24451).
	* src/grep.c (offset_width): New static var.
	(print_offset): Use it instead of arg.  All callers changed.
	(grep): Set it.
	* tests/initial-tab: Test this.

	grep: -T no longer outputs BS
	* NEWS: Document this (Bug#24451).
	* src/grep.c (print_line_head): Do not attempt to backspace output.
	* tests/initial-tab: New test.
	* tests/Makefile.am (TESTS): Add it.

	grep: document -oz better
	* doc/grep.texi (General Output Control, Usage): Tweak (Bug#24961).

	grep: fix performance typo with -P
	Reported by Zev Weiss in: http://bugs.gnu.org/22655#88
	* src/pcresearch.c (Pcompile): Initialize reflags.

	tests: use "returns_" rather than "$?"
	* tests/grep-dev-null-out: Use "returns_ 124" rather than testing
	$? = 124.

	grep -f /dev/null -L PAT FILE outputs FILE
	* NEWS: Document this.
	* src/grep.c (main): Do not exit right away with -L.
	* tests/skip-read: Test for the fix.

	grep: tune -f /dev/null
	* src/grep.c (main): Do the -f /dev/null early-exit checks before
	more-expensive tests that involve syscalls.

	grep: treat -f /dev/null like -m0
	* NEWS: Document this.
	* src/grep.c (main): With -f /dev/null, don't bother to read the
	input.  This is what FreeBSD grep does.
	* tests/Makefile.am (TESTS): Add skip-read.
	* tests/skip-read: New file.

	grep: avoid O(N**2) buffer reallocation
	* src/grep.c (main): Use x2realloc to avoid O(N**2) performance as
	pattern buffers grow.

	grep: avoid unnecessary gettext call
	Translate "(standard input)" lazily.
	* src/grep.c (input_filename): New function.
	(suppressible_error): Remove 1st arg, since it is always
	input_filename ().  All callers changed.
	(suppressible_error, print_filename, grep, grepdesc): Use it.
	(grep_command_line_arg): Set filename to NULL if standard
	input has no label.  Often, this avoids all calls to gettext,
	which can be a win as the first call can be expensive.

	grep: drain the input pipe faster
	* src/grep.c (dev_null_output): Now static.
	(drain_input): New function, using 'splice' if that makes sense.
	(finalize_input): Use it.
	(main): Omit now-unnecessary initialization.

	grep: scale back /dev/null speedup
	The performance improvement when output is /dev/null (commit
	af6af288eac28951b5eee1eaaf373e22b2193b7b dated 2016-05-01)
	breaks scripts that run "PROGRAM | grep PATTERN >/dev/null"
	where PROGRAM dies when writing into a broken pipe.
	Suppress the improvement if standard input is not seekable.
	Problem reported by Gary Johnson (Bug#24941).
	* NEWS: Document this.
	* src/grep.c (seek_failed): New static var.
	(seek_data_failed): Move decl earlier, to be next to seek_failed.
	(file_must_have_nulls): Skip useless syscalls if seek_failed.
	Lessen source-code nesting.
	(reset): Set seek_failed and seek_data_failed.
	Try lseek even on non-regular files.
	(grep): New arg INEOF.  All callers changed.
	Do not clear seek_data_failed here, since 'reset' now does this.
	(finalize_input): New static function.
	(grepdesc): Use it.
	(main): Do not exit on first match merely because output is
	/dev/null.
	* tests/grep-dev-null-out: Adjust to new behavior.

	grep: improve diagnostic on lseek failure
	* src/grep.c (reset): Mention the file name in the (unlikely)
	chance of an lseek failure.

	grep: avoid unnecessary isatty calls
	This fixes an inefficiency that was mistakenly introduced a while
	back, when the macro SET_BINARY became defined on all platforms.
	* src/grep.c (grepdesc, main): Do not unecessarily call isatty on
	POSIXish platforms.

	grep: -Pz no longer rejects ^, $
	Problem reported by Stephane Chazelas (Bug#22655).
	* NEWS: Document this.
	* doc/grep.texi (grep Programs): Warn about -Pz.
	* src/pcresearch.c (reflags): New static var.
	(multibyte_locale): Remove static var; now local to Pcompile.
	(Pcompile): Check for (? and (* too.  Set reflags instead of
	dying when problematic operators are found.
	(Pexecute): Use reflags to decide whether searches should
	be multiline.
	* tests/pcre: Test new behavior.

2016-11-14  Jim Meyering  <meyering@fb.com>

	tests: use "returns_" rather than explicit comparison with "$?"
	* tests/sjis-mb (encode): Rearrange to emit desired input into
	a file, rather than piping directly into grep.  That permits
	the use of returns_ 1 to verify timeout's exit status.
	* tests/euc-mb: Use "returns_ 1" rather than testing $? = 1
	* tests/char-class-multibyte: Likewise.
	* tests/dfa-heap-overrun: Likewise.
	* tests/encoding-error: Likewise.
	* tests/fedora: Likewise.
	* tests/grep-dev-null: Likewise.
	* tests/init.cfg (envvar_check_fail): Likewise.
	* tests/kwset-abuse: Likewise.
	* tests/mb-non-UTF8-overrun: Likewise.
	* tests/multibyte-white-space: Likewise.
	* tests/pcre-infloop: Likewise.
	* tests/surrogate-pair: Likewise.
	* tests/warn-char-classes: Likewise.
	Do the same for other values:
	* tests/backref-multibyte-slow: Likewise.
	* tests/euc-mb: Likewise.
	* tests/pcre-abort: Likewise.
	* tests/pcre-jitstack: Likewise.
	* tests/repetition-overflow: Likewise.
	* tests/reversed-range-endpoints: Likewise.
	* tests/warn-char-classes: Likewise.

2016-10-26  Jim Meyering  <meyering@fb.com>

	doc: grep builds on HP-UX once again
	* NEWS (Bug fixes): Mention the HP-UX fix.

	gnulib: update to latest, for getprogname HPUX port

2016-10-22  Mark Veltzer  <mark.veltzer@gmail.com>

	ignore coverage generated files

	ignore ar-lib in build-aux

2016-10-20  Zev Weiss  <zev@bewilderbeest.net>

	grep: use 'j' intmax_t printf length modifier if supported
	* configure.ac: Use gl_PRINTF_SIZES_C99 to test printf and
	(conditionally) define HAVE_PRINTF_C99_SIZES.
	* src/grep.c (print_offset): Use printf("%j...") for printing
	[u]intmax_t if HAVE_PRINTF_C99_SIZES is defined; otherwise continue
	using the existing hand-rolled loop.

2016-10-15  Jim Meyering  <meyering@fb.com>

	build: distribute new file, die.h, so "make distcheck" passes
	* src/Makefile.am (grep_SOURCES): Add die.h.
	Also, sort these file names.

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

	build: update gnulib submodule to latest

2016-10-09  Jim Meyering  <meyering@fb.com>

	maint: die.h: add the "#define ..." part of double inclusion guard
	* src/die.h (DIE_H): Define to 1.

2016-10-04  Paul Eggert  <eggert@cs.ucla.edu>

	grep: don't assume stdbool.h before die call
	* src/die.h: Include stdbool.h, since 'die' uses 'false'

	grep: die more systematically
	* src/die.h: New file.
	* src/dfasearch.c, src/grep.c, src/pcresearch.c: Include die.h.
	* src/dfasearch.c (dfaerror):
	* src/grep.c (context_length_arg, add_count, prline, setmatcher, main):
	* src/pcresearch.c (jit_exec, Pcompile, Pexecute):
	Use 'die' instead of 'error' when exiting.
	* src/pcresearch.c: Do not include verify.h.
	(die): Remove; now in die.h.
	* src/search.h: Do not include error.h here, since this file does
	not use anything defined in error.h.  Instead, dfasearch.c, which
	uses error.h's symbols, now includes error.h directly.

2016-10-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 2.26
	* NEWS: Record release date.

2016-10-01  Jim Meyering  <meyering@fb.com>

	gnulib: update to latest; for getprogname fix

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

	tests/grep-dir: port to Solaris 10
	* tests/grep-dir: Port to Solaris 10 'cat', which
	exits with status 0 even after 'read' fails from a directory.

2016-09-28  Jim Meyering  <meyering@fb.com>

	build: placate GCC 7's -Wimplicit-fallthrough
	* src/pcresearch.c (die): New macro.
	(Pexecute): Use it in place of offending uses of error,
	to placate GCC 7's -Wimplicit-fallthrough.
	Include verify.h.  Since this is grep's first explicit use of this
	gnulib module, ...
	* bootstrap.conf (gnulib_modules): Add verify.

	gnulib: update to latest; for ...
	This includes the following:
	 - a getprogname-vs-openbsd-5.1 portability fix
	 - "fallthru" comment-adding changes for dfa and unistr/u8-uctomb-aux.c
	 - another getprograme fix to avoid breaking newer glibc

2016-09-27  Paul Eggert  <eggert@cs.ucla.edu>

	build: reword .git old-GCC warning
	* configure.ac (gl_gcc_warnings): Reword diagnostic.
	Suggested by Assaf Gordon in:
	http://lists.gnu.org/archive/html/grep-devel/2016-09/msg00024.html

	build: port .git builds to newer GCC
	* configure.ac (gl_gcc_warnings): Omit duplicate copy of 'main'.
	Problem reported by Assaf Gordon in:
	http://lists.gnu.org/archive/html/grep-devel/2016-09/msg00024.html

	build: port .git builds to older GCC
	Problem reported by Dagobert Michelsen in:
	http://lists.gnu.org/archive/html/grep-devel/2016-09/msg00018.html
	* configure.ac (gl_gcc_warnings): Default to false if .git
	exists but GCC is too old.

2016-09-27  Jim Meyering  <meyering@fb.com>

	tests/long-pattern-perf: avoid false-failure due to cache speed
	* tests/long-pattern-perf: This test would fail semi-consistently
	on some systems, probably because the smaller regexp fit well
	within cache, yet the larger one did not.  In that case, there
	was a relative speed difference greater than 20x and the test
	would fail.  Quadruple the sizes, to make that less likely.
	Also, construct the 10x larger regexp directly from the smaller,
	rather than relying on seq with endpoints to induce that
	approximate size ratio.  Reported by Bruce Dubbs in
	https://lists.gnu.org/archive/html/grep-devel/2016-09/msg00013.html

2016-09-24  Jim Meyering  <meyering@fb.com>

	build: avoid "./configure && make dist" missing-dep. failure
	* Makefile.am (run-syntax-check): Depend on "all", to avoid a
	parallel build failure due to a missing dependency. Reported by
	Paul Eggert in https://bugs.gnu.org/24256#50

