2023-01-15  Jim Meyering  <meyering@meta.com>

	version 3.9
	* NEWS: Record release date.

	build: update gnulib to latest

2023-01-05  Jim Meyering  <meyering@fb.com>

	tests: avoid large-subopt XPASS on systems without perl
	* tests/large-subopt: Use $PERL, rather than hard-coding "perl".
	* bootstrap.conf (gnulib_modules): Add "perl" to the list.
	Reported by Bruno Haible in
	https://lists.gnu.org/r/diffutils-devel/2023-01/msg00000.html

2023-01-05  Bruno Haible  <bruno@clisp.org>

	tests: avoid a test failure when using Solaris 11.4's old grep
	* tests/colors (nanosecond_zeros): Use a dumbed-down grep '\.'
	in place of "grep -F ." to accommodate Solaris 11.4's old versions
	of grep in the default PATH. Reported here:
	https://lists.gnu.org/r/diffutils-devel/2023-01/msg00001.html

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

	build: update gnulib to latest

	maint: update copyright dates

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

	build: simplify GCC 12 false alarm workaround
	* src/util.c (print_message_queue): Pacify GCC in a
	more-straightforward way.

	maint: fix assumption typo
	Fix a typo I introduced in my August 2021 signal handling fixes.
	Problem reported by Sam James (Bug#60457).
	* src/util.c (xsigismember): Don’t assume sigismember cannot return 0.

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

	build: update gnulib to latest

	build: temp?-disable -Wanalyzer-use-of-uninitialized-value
	* src/util.c (print_message_queue): This function triggers false
	positive warnings from GCC12, so add pragmas to ignore that new warning
	in this one function. Required when using either of these:
	- gcc version 12.2.1 20221121
	- gcc version 13.0.0 20221229 (experimental)

2022-12-11  Jim Meyering  <meyering@fb.com>

	build: update gnulib to latest

2022-11-12  Jim Meyering  <meyering@fb.com>

	build: update gnulib to latest

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

	doc: mark up SEE ALSO (Bug#53976)

2022-01-24  Jim Meyering  <meyering@fb.com>

	tests: fix false-failure on systems without valgrind
	* tests/init.cfg (require_valgrind_): Use exit status of subshell,
	not that of the "local" declaration.

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

	build: update gnulib submodule to latest

2022-01-03  Jim Meyering  <meyering@fb.com>

	maint: avoid new syntax-check failure
	* cfg.mk (local-checks-to-skip): Add sc_indent, to skip it.
	Otherwise, "make syntax-check" would fail.

	maint: make update-copyright

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

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

	maint: modernize README-{hacking,prereq}

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

	doc: copy fdl.texi into git
	This pacifies this notice from ./bootstrap: “Notice from module
	fdl: Don't use this module! Instead, copy the referenced license
	file into your version control repository.”
	* bootstrap.conf (gnulib_modules): Remove fdl.
	* doc/fdl.texi: New file, taken from Gnulib.

	maint: direct dependency on time_rz now
	Now that diff calls tzalloc, it depends directly on time_rz.
	* bootstrap.conf (gnulib_modules): Add time_rz.

	build: update gnulib submodule to latest

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

	diff: fix timezone bug on Solaris
	Problem reported by Vladimir Marek (bug#51228).
	* NEWS: Mention this.
	* src/context.c (print_context_label): Pass localtz to nstrftime,
	instead of always passing 0.
	* src/diff.c (main) [!HAVE_TM_GMTOFF]:
	Initialize localtz if time_format uses %z.
	* src/diff.h (localtz): New decl.
	* tests/Makefile.am (TESTS): Add timezone.
	* tests/timezone: New test.

2021-08-31  Paul Eggert  <eggert@cs.ucla.edu>

	diff3: port better to MS-Windows
	* src/diff3.c (enum diff_type): Prefix constants like ADD with
	"DIFF_" to avoid collisions with unwise system headers.

2021-08-30  Paul Eggert  <eggert@cs.ucla.edu>

	maint: port better to non-POSIX
	Problem privately reported by Gisle Vanem for MS-Windows.
	* src/util.c (sig, install_signal_handlers):
	Don’t assume SIGTSTP, SIGALRM, SIGQUIT.
	(is_tstp_index): New function, for use in SIGTSTP avoidance.

	maint: prefer attribute.h attributes
	Prefer the macros used in attribute.h, and _Noreturn,
	to the by-hand use of __attribute__, as this is more portable.
	* bootstrap.conf (gnulib_modules): Add attribute.
	* src/system.h: Include attribute.h.  All uses of
	attributes changed to use the attribute.h macros.
	Plus, use _Noreturn.
	(FALLTHROUGH): Remove; attribute.h now defines this.

	build: update gnulib submodule to latest

	diff: avoid double translation
	* src/analyze.c (briefly_report): Do not translate here,
	as ‘message’ translates its format.

	diff: use variable arg list for messages
	This simplifies the code by using varargs.
	* bootstrap.conf (gnulib_modules): Add flexmember.
	(XGETTEXT_OPTIONS): Do not flag message5.
	* src/util.c: Include flexmember.h, stdarg.h.
	(struct msg): New members msgid, argbytes.  args is now
	FLEXIBLE_ARRAY_MEMBER, and does not contain msgid.
	All uses changed.
	(message): Now varargs.  Detect number of args by counting '%'s.
	Use FLEXSIZEOF, to avoid problems on systems with buggy
	allocators.  Avoid redundant ‘*p = 0’ when *p is already zero
	after stpcpy.
	(message5): Remove; all callers changed to use ‘message’.
	(print_message_queue): Abort if too many args were passed;
	this cannot happen with current diffutils.

2021-08-29  Paul Eggert  <eggert@cs.ucla.edu>

	diff: port better to MS-Windows
	Problem reported by Gisle Vanem (Bug#36488#30).
	* src/util.c (xsigaction) [SA_NOCLDSTOP]: Remove; no longer needed.
	(install_signal_handlers): If the first call to sigaction or
	signal fails, do not exit; just skip the signal and continue,
	in case the runtime does not support the signal even though the
	corresponding SIG* macro is defined.

2021-08-28  Paul Eggert  <eggert@cs.ucla.edu>

	diff: cleanup signal handling just before exit
	This should fix an unlikely signal handling bug with colored
	output, and should also fix a Debian FTBFS (Fails To Build From
	Source) on powerpc64le-linux.  See Bug#34519 and Frédéric
	Bonnard’s report in:
	https://bugs.debian.org/922552#19
	* bootstrap.conf (gnulib_modules): Add raise, sigprocmask.
	* src/diff.c (main): Call cleanup_signal_handlers before exiting.
	Don’t bother calling ‘exit’; no longer needed nowadays.
	* src/util.c (sigprocmask, siginterrupt) [!SA_NOCLDSTOP]:
	Define to 0 instead of empty, since the results are now used.
	(sigset_t) [!SA_NOCLDSTOP]: Remove; we now rely on Gnulib.
	(xsigaction) [SA_NOCLDSTOP]: New function.
	(xsigaddset, xsigismember, xsignal, xsigprocmask): New functions.
	(some_signals_caught): New static var.
	(process_signals): Omit a conditional branch.
	Don’t bother loading interrupt_signal if stop_signal_count is nonzero.
	(process_signals, install_signal_handlers):
	Check for failures from sigprocmask etc.
	(sig, nsig): Now at top level, since multiple functions need them.
	(install_signal_handlers): No need for caught_sig array;
	just use caught_signals.  However, set some_signals_caught.
	(cleanup_signal_handlers): New function.

2021-08-22  Paul Eggert  <eggert@cs.ucla.edu>

	diff: add integer overflow checking
	* src/diff.c (option_list, main): Check for integer overflow
	in some unlikely and hard-to-test cases.

	maint: refactor integer overflow checking
	Rely on more-modern Gnulib capabilities instead of doing
	integer overflow checking by hand, in some cases.
	* lib/cmpbuf.c (buffer_lcm):
	* src/io.c (slurp, find_identical_ends):
	Use INT_ADD_WRAPV and INT_MULTIPLY_WRAPV rather than checking
	overflow by hand.
	* src/diff3.c (process_diff):
	* src/dir.c (dir_read):
	* src/io.c (find_identical_ends, read_files):
	Use xnmalloc rather than checking overflow by hand.
	(read_files): Rely on xcalloc to do overflow checking.

	diff: avoid sprintf %s
	sprintf fails if the result contains more than INT_MAX bytes,
	so rework the code to avoid usage of sprintf %s where the
	string might be longer than that.
	* bootstrap.conf (gnulib_modules): Remove xvasprintf.
	* src/diff.c (specify_style):
	* src/util.c (begin_output):
	Rewrite to avoid sprintf %s.
	* src/util.c: Do not include xvasprintf.h.
	(concat): Remove, as it uses sprintf %s.  All uses rewritten.

	diff: use mempcpy
	* bootstrap.conf (gnulib_modules): Add mempcpy, stpcpy.
	* src/ifdef.c (do_printf_spec):
	* src/sdiff.c (expand_name, lf_snarf, temporary_file):
	* src/util.c (message5):
	Prefer mempcpy to memcpy plus manual size-updating.
	Prefer stpcpy to mempcpy plus manual size-spec.

	sdiff: fix unlikely memory leak
	* src/sdiff.c (temporary_file): Fix memory leak when mkstemp fails.
	Don’t assume temporary file name length fits in ‘int’.

	diff3: simplify process_diff
	* src/diff3.c (process_diff): Remove LAST_BLOCK arg, since callers
	no longer needed it.  All callers changed.  This removes an
	unnecessary initialization of bptr to NULL.

	maint: modernize IF_LINT for GCC 11.2.1
	* src/cmp.c (cmp):
	* src/dir.c (find_dir_file_pathname):
	* src/sdiff.c (edit):
	Mention which GCC bug this IF_LINT works around.
	* src/diff3.c (process_diff):
	Always initialize to NULL, to avoid problems on mostly-theoretical
	hosts where accessing uninitialized variables traps.  The next
	patch will have a better fix for this.
	* src/ifdef.c (do_printf_spec):
	No need for IF_LINT in GCC 11.2.1.

	maint: lint → GCC_LINT
	‘lint’ is for traditional lint and perhaps some other tools;
	‘GCC_LINT’ is targeted more for what we do.
	Gnulib accepts either, but we might as well be more accurate.
	* configure.ac (GCC_LINT): Define this instead of ‘lint’.
	All uses changed.

	diff: remove printint
	* src/system.h (printint): Remove.  All uses removed.  This type
	was only for porting to pre-C89 hosts, and is no longer needed.

	diff: remove INT_MAX limit on -F/-p searches
	* src/context.c (find_function): Don’t limit function-line
	searches to INT_MAX bytes, removing a FIXME.

	maint: .gitignore updates
	* .gitignore: Remove lib/unused-parameter.h.  Add all of m4, since
	no files there need to be committed; this lets us remove
	m4/.gitignore and m4/gnulib-cache.m4.  Add *.orig, *.patch, .Tpo,
	/*.diff, lib/*/ (which lets us remove /lib/sys/), lib/ctype.h,
	lib/errno.h, lib/float.h, lib/fnmatch.h, lib/getopt-cdefs.h,
	lib/getopt.h, lib/limits.h, lib/sigsegv.h, lib/stdalign.h,
	lib/stdarg.h, lib/stdbool.h, lib/stddef.h, lib/stdint.h,
	lib/stdopen.[ch], vc-dwim-log-*.  Add slashes to autom4te.cache,
	build-aux.  Remove redundant initial slashes from patterns that
	also have internal slashes.  Remove plain ABOUT-NLS, since
	/ABOUT-NLS suffices.  Sort using LC_ALL=C.

	maint: omit unused function if not debugging
	* src/util.c (debug_script): Compile only if DEBUG.

	maint: remove prepargs
	* lib/Makefile.am (noinst_HEADERS): Remove prepargs.h.
	(libdiffutils_a_SOURCES): Remove prepargs.c.
	* lib/prepargs.c, lib/prepargs.h: Remove.  Hasn’t been
	needed for many years.
	* src/diff.c: Do not include prepargs.h.

	maint: zalloc → xzalloc
	* src/util.c (zalloc): Remove.  All uses replaced
	by xzalloc, which means the same thing.

2021-08-22  Paul Eggert  <eggert@cs.ucla.edu>

	diff3: suppress -fanalyzer alarms
	* src/diff3.c: Add pragma to suppress -Wanalyzer-null-dereference
	alarms.

	* src/diff.h (find_dir_file_pathname): Add malloc-related
	attributes, to pacify gcc -Wsuggest-attribute=malloc.

2021-08-22  Paul Eggert  <eggert@cs.ucla.edu>

	maint: remove January workaround for Gnulib issue
	* configure.ac: Don’t add -Wno-analyzer-null-argument, since
	the issue is now fixed in Gnulib.

	build: update gnulib submodule to latest

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

	maint: remove stray init.cfg
	* init.cfg: Remove.  I guess this file was a stray, since it was a
	copy of tests/init.cfg when it was checked in, and it hasn’t been
	maintained since.

	tests: port to valgrind 3.16.0 + GCC 11.2
	* tests/init.cfg (stderr_fileno_): Reject valgrind if it reports a
	"Serious error" on a trival use of ‘diff’.  Without this patch, on
	RHEL 8.4 when I compile diffutils with a GCC 11.2.0 that I built
	myself, ‘valgrind diff’ spits out messages like WARNING: Serious
	error when reading debug info / When reading debug info from diff:
	Ignoring non-Dwarf2/3/4 block in .debug_info’ and this causes the
	strip-trailing-cr test to fail.  I guess valgrind complains
	because the valgrind version 3.16.0 that came with RHEL 8.4 cannot
	grok the debug entries generated by GCC 11.2.0.

2021-08-01  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.8
	* NEWS: Record release date.

	build: update gnulib to latest

2021-07-31  Jim Meyering  <meyering@fb.com>

	cmp: avoid reading uninitialized memory
	[This *is* useful, so reapply. ]
	When comparing buffers a word at a time, cmp could read up to
	sizeof (word) - 1 uninitialized bytes.
	* src/cmp.c (cmp): Set not just a single guaranteed-differing
	sentinel byte just beyond any final read byte, but also ensure
	that any following bytes are defined, if those may be read via
	block_compare's word-at-a-time comparison.  Reported by Bruno Haible
	in https://lists.gnu.org/r/diffutils-devel/2021-07/msg00003.html

2021-07-28  Bruno Haible  <bruno@clisp.org>

	cmp: avoid reading uninitialized memory
	One or both of the sentinel bytes were copies of uninitialized values.
	* src/cmp.c (cmp): Use arbitrary initialized values for the
	sentinel bytes.

2021-07-28  Jim Meyering  <meyering@fb.com>

	cmp: revert preceding change
	It did not solve the problem. The next patch does.

2021-07-27  Jim Meyering  <meyering@fb.com>

	cmp: avoid reading uninitialized memory
	When comparing buffers a word at a time, cmp could read up to
	sizeof (word) - 1 uninitialized bytes.
	* src/cmp.c (cmp): Set not just a single guaranteed-differing
	sentinel byte just beyond any final read byte, but also ensure
	that any following bytes are defined, if those may be read via
	block_compare's word-at-a-time comparison.  Reported by Bruno Haible
	in https://lists.gnu.org/r/diffutils-devel/2021-07/msg00003.html

2021-07-19  Paul Eggert  <eggert@cs.ucla.edu>

	build: update gnulib submodule to latest

2021-05-21  Paul Eggert  <eggert@cs.ucla.edu>

	diff: better --color help
	* src/diff.c (option_help_msgid): Reword --color help without
	using the confusing word “default”.  Problem reported
	by Peter Oliver (Bug#48532).

2021-05-20  Paul Eggert  <eggert@cs.ucla.edu>

	doc: fix URL in HACKING

2021-03-24  Paul Eggert  <eggert@cs.ucla.edu>

	diff: pacify compiler re style
	* src/diff.c (usage): Prefer &"string"[N] to "string" + N.
	Some compilers complain about the latter, as they worry C++
	refugees will think it’s string concatnation.

	diff3: avoid signed int overflow
	* src/diff3.c (main): Avoid signed integer overflow in the very
	unlikely case of more than INT_MAX incompatible options.  Instead,
	use one bit to record the presence of each type of incompatible
	option, and report an error if more than one bit is set.

	maint: don’t bother with -Wno-return-local-addr
	* configure.ac (WERROR_CFLAGS): Don’t bother with
	-Wno-return-local-addr as it doesn’t seem to work.
	Anyway, it’s no longer needed on Ubuntu 20.10.

	maint: disable -Wstack-protector
	* configure.ac (WERROR_CFLAGS): Disable -Wstack-protector, as it
	has a false alarm with lib/vasnprintf.c on Ubuntu 20.10 and it’s
	not worth working around.  Coreutils already disables it.

	diff: plug memory leak in ifdef.c
	Problem reported by Than (Bug#47362).
	Fix the bug by using xmalloca instead of vararrays.
	* bootstrap.conf (gnulib_modules): Add xmalloca; remove vararrays.
	* configure.ac: Remove AC_C_VARARRAYS.
	* src/ifdef.c: Include xmalloca.h instead of xalloc.h.
	(do_printf_spec): Use xmalloca instead of an xmalloc
	that lacks a corresponding ‘free’ if HAVE_C_VARARRAYS
	due to a typo in 2017-05-18T05:51:31Z!meyering@fb.com.

	build: update gnulib submodule to latest

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

	maint: work around GCC -Wreturn-local-addr bug
	* configure.ac: Do not use -Wreturn-local-addr in Gnulib,
	to suppress a false alarm in vasnprintf.c.

2021-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.

2020-12-05  Jim Meyering  <meyering@fb.com>

	build: require autoconf-2.64
	* configure.ac: Require 2.64, up from 2.63, to align with gnulib.

2020-03-15  Jim Meyering  <meyering@fb.com>

	build: update gnulib to latest

	doc: adjust formatting to make apropos (man -k) work better
	* man/Makefile.am $(dist_man1_MANS): Adjust sed substitution
	to also remove the space after "GNU". This avoids the single
	leading space on each man page title line.  I'm guessing that
	interfered with indexing/searching, causing "man -k diff3" to
	print this: diff3 (1) - (unknown subject).
	Reported by Dan Jacobon in http://bugs.gnu.org/39769.

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

	doc: correct an ancient "At present"
	* doc/diffutils.texi (Unified Format): Correct the now
	seriously outdated "At present" (referring to early 1990s)
	statement to be more of a historical note.
	Reported by Roland Illig in http://bugs.gnu.org/39184.

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

	doc: use program name, not "GNU", in the nroff/man header
	* man/Makefile.am (dist_man1_MANS): Elide "GNU " prefix
	from the generated prog+one-line-summary, so that help2man
	uses the program name rather than "GNU" as the nroff "name".
	Reported by Dan Jacobson in http://bugs.gnu.org/38574.

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.

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

	maint: avoid gnulib-tool deprecation warnings, and build failure
	* bootstrap.conf (gnulib_modules): Use getopt-gnu, rather than
	obsolete "getopt" module. Use nstrftime in place of strftime.
	(avoided_gnulib_modules): Do not avoid the "lock" module. That
	would lead to a build failure due to "glthread/lock.h not found".

	maint: avoid syntax-check failure
	* po/POTFILES.in: Add argmatch.h; remove xstrtol-error.c

	maint: disable two and reenable many warning options
	* configure.ac (GNULIB_WARN_CFLAGS): Disable -Wduplicated-branches
	and -Wreturn-local-addr, due to a couple of false-positive warnings.
	(WARN_CFLAGS): Reenable many warnings that now (with recent gcc)
	provoke no false positive.

	maint: avoid gnulib's lock-tests module
	* bootstrap.conf (avoided_gnulib_modules): Also --avoid=lock-tests
	to avoid gnulib-related build failure.

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

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

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

	maint: tweak bootstrap.conf
	* bootstrap.conf (buildreq): Require at least autoconf 2.62,
	up from 2.61, just as grep and coreutils do.
	(bootstrap_post_import_hook): "Copy pkg-config's pkg.m4 ...",
	copied from grep's bootstrap.conf.
	(avoided_gnulib_modules): Pull this definition to the top.
	Formatting.

2019-10-01  Dave Odell  <dmo2118@gmail.com>  (tiny change)

	cmp: add test case for Bug#37558
	* tests/cmp: New test case (Bug#37558).

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

	cmp: fix -l width bug
	Problem reported by Dave Odell (Bug#37558).
	* src/cmp.c (cmp): Treat negative ‘bytes’ as infinite, fixing a
	bug introduced in the 2019-08-27 patch that fixed Bug#35256.

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

	diff: don’t mistreat -N in arg as a large number
	Problem reported by alec (Bug#35256).
	* NEWS: Mention the fix.
	* bootstrap.conf (gnulib_modules): Use strtoimax and xstrtoimax,
	not strtoumax and strtoumax.
	* src/cmp.c (bytes): Now signed, with -1 representing no limit.
	All uses changed.
	* src/cmp.c (specify_ignore_initial, main):
	* src/diff.c (main):
	* src/ifdef.c (format_group):
	* src/sdiff.c (interact):
	Use strtoimax, not strtoumax.

	build: update gnulib submodule to latest

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

	maint: ignore ‘configure’ temporaries
	* .gitignore: Ignore confdefs*, conftest*.

	maint: avoid Gnulib setlocale module
	Problem reported for MS-Windows by Richard Gering (Bug#34376).
	Diffutils doesn’t need any of the Gnulib fixes for setlocale.
	* bootstrap.conf (gnulib_tool_option_extras):
	Avoid the setlocale module.

2019-05-24  KO Myung-Hun  <komh@chollian.net>

	tests: init.cfg: use $PATH_SEPARATOR not ':'
	On OS/2, a path separator is semi-colon ';' not colon ':'.
	* tests/init.cfg: Replace ':' with $PATH_SEPARATOR.

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
	* gnulib: Update to latest.
	* po/POTFILES.in: Add lib/xstdopen.c.

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

	diff: use xstdopen, not stdopen
	* bootstrap.conf (gnulib_modules):
	* src/cmp.c, src/diff.c, src/diff3.c, src/sdiff.c (main):
	Use xstdopen, not stdopen.

	build: update gnulib submodule to latest

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

	maint: convert all TABs to equivalent spaces in indentation
	Using this file,

	cat > leading-blank.exempt <<\EOF
	(\.gitmodules|help2man|pre-commit)$
	(?:^|\/)ChangeLog[^/]*$
	(?:^|\/)(?:GNU)?[Mm]akefile[^/]*$
	\.(?:am|mk)$
	EOF

	run the following command to convert all non-conforming leading white
	space to be all spaces:

	git ls-files \
	  | pcregrep -vf leading-blank.exempt \
	  | xargs pcregrep -l '^ *\t' \
	  | xargs perl -MText::Tabs -ni -le \
	    '$m=/^( *\t[ \t]*)(.*)/; print $m ? expand($1) . $2 : $_'

	Since that changed old NEWS, I also ran "make update-NEWS-hash"
	to update the old_NEWS_hash value in cfg.mk.

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

	diff: fix cmp, diff3, sdiff with stdin closed
	* NEWS: Mention this.
	* src/cmp.c, src/diff3.c, src/sdiff.c: Include stdopen.h.
	(main): Call stdopen early.
	* src/cmp.c (main): Simplify now that we need not worry about
	stdin being closed.
	* src/diff.c (main): Translate stdopen diagnostic.

	diff: remove unportable ‘diff -N - f <&-’ feature
	* NEWS: Mention this.
	* bootstrap.conf (gnulib_modules): Add stdopen.
	* doc/diffutils.texi (Comparing Directories):
	Do not document behavior if stdin is closed.
	* src/diff.c: Include stdopen.h.
	(main): Call stdopen early.
	(compare_files) [__hpux]: Remove recently-introduced
	special case for HP-UX exec with stdin closed.
	* tests/new-file: Remove tests of the removed feature.

	build: update gnulib submodule to latest

2019-01-03  Bruno Haible  <bruno@clisp.org>

	diff: recognize file descriptors closed by the parent process on HP-UX
	* src/diff.c (compare_files): Use fcntl to distinguish a file
	descriptor closed by the parent process from a file descriptor
	that references /dev/null.

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-31  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.7
	* NEWS: Record release date.

	maint: distribute new file, init.cfg
	Otherwise, strip-trailing-cr would fail on a system without valgrind.
	* tests/Makefile.am (EXTRA_DIST): Include init.cfg.

2018-12-30  Dennis Lambe Jr  <malsyned@malsyned.net>

	diff: adjust ANSI escapes for compatibility with less -R
	GNU less can display ANSI-colored text with the -R flag, but this
	support has some limitations. One of them is that if an escape
	sequence starts on one line and ends on a different line, only the
	first line will be colored in less.

	As a result, when diff creates colored output with multi-line deletes
	or adds, less will only color the first line.

	This change resets ANSI color to the default at the end of
	each line and restarts it at the beginning of the next. It patches
	normal and context mode. Side-by-side already worked in my testing.
	* src/context.c (print_context_label, pr_context_hunk): As above.
	(pr_unidiff_hunk, print_context_header): Likewise.
	* src/normal.c (print_normal_hunk): Likewise.
	* tests/colors: Adjust existing tests to accommodate this.
	* NEWS (Improvements): Mention it.
	Proposed in http://bugs.gnu.org/31105

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

	tests: fix colors test on systems lacking fractional timestamp support
	* tests/colors: The .NNNNNNNNN suffix is not printed on some systems.
	Adapt the test to accommodate those systems.

	tests: strip-trailing-cr: avoid failure with ASAN
	Valgrind cannot operate on an ASAN-compiled binary.
	* tests/strip-trailing-cr (valgrind): Define as no-op when diff
	was compiled with sanitizer support.

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

	tests: add test for --strip-trailing-cr UMR bug
	* tests/strip-trailing-cr: New file. Test for today's bug fix.
	* tests/Makefile.am (TESTS): Add it.

	tests: import test infrastructure from coreutils
	* tests/init.cfg: New file, for require_valgrind_ definition (from coreutils).
	* tests/Makefile.am (PATH): Don't set stderr_fileno_ here, since it is
	now initialized in init.cfg.

2018-12-28  Paul Eggert  <eggert@cs.ucla.edu>
	    Jim Meyering  <jim@meyering.net>

	diff: fix UMR with --strip-trailing-cr
	Problem reported by Hongxu Chen (Bug#31935).
	* src/io.c (prepare_text): Strip trailing CR before
	doing the rest of the analysis.
	* NEWS: Mention the fix.

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

	tests: colors: avoid test failure on AIX 7
	* tests/colors: Splice the argument into the printf format string.

2018-12-27  Bruno Haible  <address@hidden>

	maint: don't use an undocumented Autoconf macro
	* configure.ac: Use AC_CONFIG_HEADERS instead of AC_CONFIG_HEADER.

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

	build: avoid build failure with --enable-gcc-warnings and latest gcc
	* src/diff.c (usage): Assert that each line length is no longer than
	the minimum required size of 4095.  This lets newer gcc (currently
	9.0.0 20181219) infer that it need not issue this warning:
	diff.c:1012:19: error: '%.*s' directive output between 0 and 2147483647
	bytes may exceed minimum required size of 4095
	[-Werror=format-overflow=]
	1012 |        printf ("  %.*s", msglen, msg);

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

	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-20  Jim Meyering  <meyering@fb.com>

	maint: use https: in gnu mirror URL prefix, not http
	This appears in the generated release announcement message.
	* cfg.mk (url_dir_list): Use https: prefix, not http:.

2018-07-24  Paul Eggert  <eggert@cs.ucla.edu>

	cmp: fix bug in -b diagnostic
	Problem reported by mancha (Bug#32249).
	* src/cmp.c (count_newlines): Restore old value of sentinel.
	* tests/cmp: Test for the bug.

	build: update gnulib submodule to latest

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

	doc: prepend "GNU" to NAME in man pages
	Requested by RMS.
	* src/cmp.c, src/diff.c, src/diff3.c, src/sdiff.c:
	Prepend "GNU" to first comment, so that the man page says "GNU".

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

	sdiff: port to mingw
	Problem reported by Ross Burton (Bug#31218).
	* src/sdiff.c (checksigs): Use ‘raise’, not ‘kill’.

2018-03-23  Paul Eggert  <eggert@cs.ucla.edu>

	build: update gnulib submodule to latest

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

	tests: fix quoting error in previous change
	* tests/colors: Double-quote $PATH.

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

	tests: port tests/colors to some env-munging shell
	* tests/colors: Also set PATH="$PATH" in env invocation.

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

	maint: suppress gcc's new -Wcast-function-type in gnulib
	* configure.ac (WERROR_CFLAGS): Suppress gcc's new -Wcast-function-type
	warning in gnulib, because it would trigger on this:
	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-10-22  Jim Meyering  <meyering@fb.com>

	tests: add expected-failing test for minor subopimality
	In some unusual cases, diff -u prints suboptimal output.
	* tests/large-subopt: New test script.
	* tests/Makefile.am (TESTS): Add it.
	(XFAIL_TESTS): Add it here, too, to record that this test is
	currently expected to fail.
	* tests/large-subopt.in1, tests/large-subopt.in2: Inputs derived from
	those in http://bugs.gnu.org/28796

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

	gnulib: update to latest

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

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

	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.6
	* NEWS: Record release date.

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

	gnulib: update to latest

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

	maint: update to work with GCC7's -Werror=implicit-fallthrough=
	* src/system.h (FALLTHROUGH): Define.
	Use new FALLTHROUGH macro in place of comments
	* src/cmp.c: FIXME
	* src/diff3.c: FIXME
	* src/ifdef.c: FIXME
	* src/sdiff.c: FIXME
	* src/side.c: FIXME
	* src/util.c: FIXME

	gnulib: update to latest

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

	tests: new-file: closed-stdin: also ensure stdout was empty
	* tests/new-file: Also require that "out" be empty.

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

	maint: stop using @acronym{...} in texinfo sources
	* doc/diffutils.texi: Remove all uses of @acronym{...},
	per recommendation by Karl Berry.
	* cfg.mk (local-checks-to-skip): Remove exemption, enabling
	the @acronym{-prohibiting syntax-check rule.

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

	cmp: improve EOF diagnostic
	This improves on yesterday's change, following up on a
	remark by Jim Meyering (Bug#22816#21).
	* doc/diffutils.texi (Invoking cmp, cmp Options): Follow POSIX more
	closely in the documentation of the information appended to the EOF
	diagnostic.
	* src/cmp.c (cmp): Be more specific about the shorter file's length
	and fix some off-by-1 issues in reporting line counts.
	* tests/cmp: Adjust to match new behavior.
	Don't assume internal details about stdio buffering.

2017-05-04  Benno Schulenberg  <bensberg@justemail.net>

	diff: describe each --help option with a single string
	* src/diff.c: To ease translating, fuse four description pieces
	into two whole ones.  Also reword and rewrap one of them to fit
	within eighty characters.

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

	cmp: report prefix length when one file is shorter
	Requested by Dan Jacobson (Bug#22816).
	* NEWS:
	* doc/diffutils.texi (Invoking cmp, cmp Options): Document this.
	* src/cmp.c (cmp): Implement it.
	* tests/Makefile.am (TESTS): Add cmp.
	* tests/cmp: New file.

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

	tests: add test for latest fix
	* NEWS (Bug fixes): Describe it.
	* tests/invalid-re: New test for just-fixed bug.
	* tests/Makefile.am (TESTS): Add it.

	gnulib: update to latest

2017-04-27  Paul Eggert  <eggert@cs.ucla.edu>

	diff: don't crash if regexp is invalid
	Problem reported by Marcel Böhme in:
	http://lists.gnu.org/archive/html/bug-diffutils/2017-04/msg00002.html
	* src/diff.c (add_regexp): Exit if re_compile_pattern fails.

2017-03-24  julama  <julama@fake-box.com>

	tests: avoid false failure for unreadable /proc/cmdline
	* tests/brief-vs-stat-zero-kernel-lies: Use "test -r" rather than
	just "test -f".  This avoids a false test failure on a linux system
	with grsecurity and its GRKERNSEC_PROC_USER option enabled, for which
	/proc/cmdline is unreadable.  Reported in https://bugs.gnu.org/26155

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

	tests: avoid false failure with some shells on debian, freebsd
	* tests/colors: Move the TERM=dumb setting into the code run by
	"returns_", since some shells do not propagate envvar setting through
	to a use of a function like this.  That would cause this test to fail
	because results were colorized when they should not have been.
	Reported by Nelson Beebe.

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

	maint: add "introduced in 3.4" in latest NEWS entry
	* NEWS: Update.  Also, thanks to Nelson Beebe for reporting this.

	diff: avoid UMR with ---presume-output-tty
	* src/diff.c (main): Always define presume_output_tty.
	Otherwise, it would be read uninitialized.
	Introduced in v3.3-45-g17e2698
	* NEWS (Bug fixes): Mention it.

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

	maint: change "time stamp" to "timestamp" globally
	This avoids a new syntax-check failure.
	* ChangeLog-2008: Perform that change.
	* doc/diffutils.texi: Likewise.
	* NEWS: Likewise.
	* cfg.mk: Update the old news hash accordingly.

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-11-08  Jim Meyering  <meyering@fb.com>

	tests: use "returns_" rather than explicit comparison with "$?"
	* tests/colors: Use "returns_ 1" rather than testing $? = 1
	* tests/basic: Likewise.
	* tests/binary: Likewise.
	* tests/filename-quoting: Likewise.
	* tests/function-line-vs-leading-space: Likewise.
	* tests/ignore-matching-lines: Likewise.
	* tests/label-vs-func: Likewise.
	* tests/new-file: Likewise.
	* tests/no-dereference: Likewise.
	* tests/no-newline-at-eof: Likewise.
	* tests/stdin: Likewise.

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

	diff: fix big performance degradation in 3.4
	* NEWS, doc/diffutils.texi (Overview): Document this.
	* src/analyze.c (diff_2_files): Restore too_expensive heuristic,
	but this time with a floor that is 16 times the old floor.  This
	should fix Bug#16848, by generating good-quality output for its
	test case, while not introducing Bug#24715, by running nearly as
	fast as diff-3.3 for that test case.

	build: update gnulib submodule to latest

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

	maint: use die rather than error
	Use "die (N, ..." rather than "error (N, ..." whenever N is a nonzero
	constant.  That lets the compiler know that control never goes beyond
	that point, and thus makes unnecessary the occasional following
	"abort ();" or "break;" statement we have historically added to inform
	static analysis tools of this aspect of "error" semantics.
	* src/die.h: New file.
	* src/Makefile.am (noinst_HEADERS): Add it.
	* src/cmp.c: Use die in place of error whenever the first
	argument is a nonzero constant.  Also remove any immediately-
	following call to abort, and include "die.h".
	* src/diff.c: Likewise.
	* src/diff3.c: Likewise.
	* src/sdiff.c: Likewise.
	* src/util.c: Likewise.

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

	gnulib: update to latest

	build: avoid GCC 7's new warnings
	* src/util.c (get_funky_string): Adjust comment so that GCC 7's
	-Wimplicit-fallthrough recognizes it.
