2023-08-29  Pádraig Brady  <P@draigBrady.com>

	version 9.4
	* NEWS: Record release date.

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

	maint: spelling fixes, including author names
	Most of this just affects commentary and documentations.  The only
	significant behavior change is translating author names via
	proper_name_lite rather than proper_name_utf8, or not translating
	them at all.  proper_name_lite is good enough for coreutils and
	avoids the bloat that had coreutils not using Gnulib proper_name.
	* bootstrap.conf (gnulib_modules): Use propername-lite instead
	of propername.
	(XGETTEXT_OPTIONS): Look for proper_name_lite instead of for
	proper_name_utf8.
	* cfg.mk (local-checks-to-skip): Remove
	sc_proper_name_utf8_requires_ICONV, since we no longer use
	proper_name_utf8.
	(old_NEWS_hash): Update.
	(sc_check-I18N-AUTHORS): Remove; no longer needed.

	test: omit unreachable code
	* src/test.c (unary_operator): Omit unreachable ‘return false;’.
	Oracle Solaris Studio 12.6 warns about it.

2023-08-28  Bruno Haible  <bruno@clisp.org>

	tests: avoid test failure on Android
	* gl/tests/test-mbsalign.c (main): Skip the unibyte truncation test
	on Android, when the "C" locale in fact is multibyte.

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

	sort: port sort-merge-fdlimit test to Solaris 10
	* tests/sort/sort-merge-fdlimit.sh: Give 'sort' fd 6 too.
	Needed for the same reason sort-continue.sh needed a ulimit -n boost.

	sort: port sort-continue test back to Solaris 10
	* tests/sort/sort-continue.sh: Use ulimit -n 7 not -n 6.  On
	Solaris 10 'sort' uses Gnulib mkostemp, which calls Gnulib
	getrandom, which opens /dev/urandom to calculate the temp file's
	name, which means 'sort' needs one more file descriptor to work.

2023-08-27  Pádraig Brady  <P@draigBrady.com>

	tests: avoid false failure on cygwin
	* tests/cksum/md5sum-bsd.sh: Avoid part of test dealing with backslashes
	in file names, on systems where backslash is a directory separator.
	Issue reported by Bruno Haible on cygwin.

2023-08-27  Pádraig Brady  <P@draigBrady.com>

	cksum: adjust tests and docs to binary mode handling
	Following commit v9.3-80-g5e1e0993b which makes cksum
	match the output of the standalone utilities...

	* doc/coreutils.texi (cksum output modes): Remove the mention
	that cksum never outputs a binary indicator, as that's no longer the
	case.
	* tests/cksum/b2sum.sh: Avoid outputting a binary indicator.
	* tests/cksum/sm3sum.pl: Likewise.

2023-08-27  Pádraig Brady  <P@draigBrady.com>

	all: avoid duplicated write errors on FreeBSD
	* src/system.h (write_error): Also call fpurge(), which was seen to
	be needed on FreeBSD 13.1 to avoid duplicated write errors.
	* src/head.c (xwrite_stdout): Likewise.
	* bootstrap.conf: Depend on fpurge.
	Reported by Bruno Haible.

	tests: avoid false failure where sleep is a shell builtin
	* tests/misc/usage_vs_getopt.sh: Handle sleep as a shell builtin,
	which was seen on Alpine Linux 3.18.

2023-08-27  Bruno Haible  <bruno@clisp.org>

	build: fix link errors of sort, split on CentOS 5 and Solaris 10
	* src/local.mk (src_sort_LDADD, src_split_LDADD): Add $(CLOCK_TIME_LIB).

	build: fix compilation error on AIX 7.1
	* src/copy.c (copy_internal): Don't test for ENOTEMPTY if it has the
	same value as EEXIST.

2023-08-27  Pádraig Brady  <P@draigBrady.com>

	build: update with gnulib fixes
	* gnulib: Update to incorporate gnulib fixes
	from Bruno Haible from his coreutils 9.4 pre-release testing.

2023-08-24  Pádraig Brady  <P@draigBrady.com>

	doc: remove older ChangeLog items
	* Makefile.am: Update the oldest documented version
	to 8.30 which is now about 5 years old.

2023-08-23  Pádraig Brady  <P@draigBrady.com>

	shred: fix operation on Solaris with 64 bit builds
	* NEWS: Mention the bug fix.
	* gl/lib/randread.c (get_nonce): Limit getrandom() <= 1024 bytes.

2023-08-22  Pádraig Brady  <P@draigBrady.com>

	build: update gnulib submodule to latest
	* gnulib: Update to latest

	doc: reorg texinfo for the checksumming utilities
	* doc/coreutils.texi: Reorg so that 'cksum invocation' is the
	main node listing all options and output formats, which is then
	referenced by the descriptions of the standalone utilities.
	Use macros in the description of the standalone utilities
	rather than referencing 'md5sum invocation' to be more direct.

2023-08-21  Pádraig Brady  <P@draigBrady.com>

	doc: cksum: remove -b description from texinfo
	* doc/coreutils.texi (cksum invocation): Following commit 5e1e0993
	also remove the desciption of the -b option for the cksum command.

	cp: with --sparse=never, avoid COW and copy offload
	* src/cp.c (main): Set default reflink mode appropriately
	with --sparse=never.
	* src/copy.c (infer_scantype): Add a comment to related code.
	* tests/cp/sparse-2.sh: Add a test case.
	* NEWS: Mention the bug.

2023-08-19  Pádraig Brady  <P@draigBrady.com>

	maint: comment spelling fix
	* tests/split/l-chunk-root.sh: Fix recently introduced typo.

2023-08-16  Pádraig Brady  <P@draigBrady.com>

	maint: remove extraneous line in NEWS
	* NEWS: Remove extraneous line.

2023-08-15  Bruno Haible  <bruno@clisp.org>

	uptime: simplify following gnulib changes
	* build-aux/gen-lists-of-programs.sh (build_if_possible_progs):
	Remove uptime.
	(normal_progs): Add uptime.
	* configure.ac: Remove GNULIB_BOOT_TIME invocation.
	* m4/boottime.m4: Remove file.
	* src/uptime.c: Don't include <sys/sysctl.h>, <OS.h>.
	(print_uptime): Don't call sysctl, get_system_info, as Gnulib's
	readutmp module now does this.

2023-08-15  Paul Eggert  <eggert@cs.ucla.edu>

	maint: update uptime NEWS
	* NEWS: Update as per Bruno Haible <https://bugs.gnu.org/65255#14>.

2023-08-15  Pádraig Brady  <P@draigBrady.com>

	tests: fix false failure due to locale on alpine
	* tests/sort/sort-debug-keys.sh: Decimal point was seen to be '.'
	on fr_FR.UTF-8 on Alpine Linux 3.18, so add an extra guard
	to ensure we've a ',' as the decimal point on this locale.
	Fixes https://bugs.gnu.org/65310

2023-08-15  Paul Eggert  <eggert@cs.ucla.edu>

	uptime: be more generous about read_utmp failure
	* src/uptime.c (print_uptime): Check for overflow
	when computing uptime.  Use C99-style decl after statements.
	Do not let an idx_t value go negative.
	(print_uptime, uptime): Be more generous about read_utmp failures,
	or when read_utmp does not report the boot time.  Instead of
	failing, warn but keep going, printing the information that we did
	get, and then exit with nonzero status.
	(print_uptime): Return the desired exit status.  Caller changed.

2023-08-15  Bruno Haible  <bruno@clisp.org>

	uptime: Include VM sleep time in the "up" duration
	* src/uptime.c: Don't include c-strtod.h.
	(print_uptime): Don't read /proc/uptime, because the value it provides
	does not change when a date adjustment occurs.
	* bootstrap.conf (gnulib_modules): Remove 'uptime'.

2023-08-15  Paul Eggert  <eggert@cs.ucla.edu>

	build: update gnulib submodule to latest

2023-08-15  Bernhard Voelker  <mail@bernhard-voelker.de>

	maint: fix typo in NEWS
	* NEWS: s|/who/log/wtmp|/var/log/tmp|, introduced in commit 85edb4afbd1.

2023-08-15  Bernhard Voelker  <mail@bernhard-voelker.de>

	doc: reference install(1) and cp(1) from each other
	* man/cp.x (SEE ALSO): Add install(1).
	* man/install.x (SEE ALSO): Add cp(1).

	Discussed at
	https://lists.gnu.org/r/coreutils/2023-08/msg00026.html

2023-08-14  Bruno Haible  <bruno@clisp.org>

	build: fix recent compilation error on GNU/Hurd
	* src/copy.c (set_author): Revert change from MACH_PORT_NULL to
	MACH_PORT_nullptr from commit 16b5ca6e (2023-06-29).

2023-08-14  Pádraig Brady  <P@draigBrady.com>

	maint: avoid syntax-check failure
	* po/POTFILES.in: Cater to lib/file-type.c adjustments
	as suggested by sc_po_check.

2023-08-14  Bruno Haible  <bruno@clisp.org>

	build: fix link errors with gcc < 4.8
	* configure.ac: Attempt to link, not only compile, the test programs
	with __builtin_cpu_supports, to avoid link errors with cksum and wc.

2023-08-13  Paul Eggert  <eggert@cs.ucla.edu>

	doc: improve NEWS discussion of systemd

	build: update gnulib submodule to latest

2023-08-12  Pádraig Brady  <P@draigBrady.com>

	maint: allow use of printf C99 integer size specifiers
	Older systems that had issues with these like HP-UX and Solaris 8
	are now obsolete, and can easily apply patches to provide support.
	Also we've used %td since coreutils 9.1, with no reported issues.

	* cfg.mk (sc_prohibit-c99-printf-format): Remove to allow use of
	%[jtz] size specifiers, which allows for cleaner code
	by avoiding the need to cast to PRI?MAX etc.

2023-08-11  Pádraig Brady  <P@draigBrady.com>

	doc: separate out description of 2038 time stamp change
	* NEWS: Separate out the description of the _existing_ issues
	with outputting timestamps on 32 bit systems, from _future_ issues
	outputting timestamps on all systems.  Also move this to the
	"improvement" section, since it's not really a coreutils
	specific issue, and also is a build time configurable option.

2023-08-11  Bruno Haible  <bruno@clisp.org>

	pinky,users,who: optimize read_utmp invocation
	When we are only interested in entries of type USER_PROCESS, tell
	read_utmp that it does not need to determine the boot time.

	* src/pinky.c (short_pinky): Pass option READ_UTMP_USER_PROCESS.
	* src/users.c (users): Likewise.
	* src/who.c (who): Likewise, if calling list_entries_who.

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

	who: simplify based on readutmp changes
	* src/pinky.c (time_string, print_entry, scan_entries, short_pinky):
	* src/uptime.c (print_uptime, uptime):
	* src/users.c (list_entries_users, users):
	* src/who.c (UT_TYPE_RUN_LVL, UT_TYPE_INIT_PROCESS)
	(UT_TYPE_LOGIN_PROCESS, UT_TYPE_DEAD_PROCESS, UT_TYPE_NEW_TIME)
	(time_string, print_user, print_boottime)
	(make_id_equals_comment, print_deadprocs, print_login)
	(print_initspawn, print_clockchange, print_runlevel)
	(list_entries_who, scan_entries, who):
	Simplify, partly by using plain -> rather than macros.

	pinky,who: omit pragma
	* src/pinky.c, src/who.c:
	Omit no-longer-needed -Wstringop-overread pragma.

2023-08-09  Bruno Haible  <bruno@clisp.org>

	maint: Simplify after gnulib changed
	Update gnulib submodule to latest.
	All of UT_USER_SIZE, UT_ID_SIZE, UT_LINE_SIZE, UT_HOST_SIZE are now -1.

	* src/pinky.c (print_entry): Remove code for bounded-length ut_line,
	ut_user, ut_host.
	(scan_entries): Remove code for bounded-length ut_user.
	* src/who.c (print_line): Remove userlen, linelen arguments.
	(print_user): Remove code for bounded-length ut_line, ut_user, ut_host.
	(make_id_equals_comment): Remove code for bounded-length ut_id.
	(print_boottime, print_deadprocs, print_login, print_initspawn,
	print_clockchange, print_runlevel, print_heading): Update print_line
	invocations.
	(scan_entries): Remove code for bounded-length ut_line.

2023-08-04  Paul Eggert  <eggert@cs.ucla.edu>

	maint: Update after gnulib module 'readutmp' changed
	(This patch is coauthored with Bruno Haible,
	with original version at <https://bugs.gnu.org/64937#>.)
	This updates the gnulib submodule to latest.
	For year-2038 safety on Linux/{x86,arm},
	this adds an --enable-systemd option to ‘configure’.
	The idea is that this sort of thing will become the default
	after it has been tested more.
	* configure.ac: Don't test whether struct utmp and struct utmpx
	have the ut_host field; this is now done in gnulib's readutmp module.
	* src/local.mk: Link the programs 'pinky', 'uptime', 'users',
	'who' with $(READUTMP_LIB).
	* src/pinky.c, src/who.c:
	Test HAVE_STRUCT_XTMP_UT_HOST instead of HAVE_UT_HOST.
	* src/pinky.c (print_entry):
	* src/who.c (print_user, print_deadprocs, print_login)
	(print_initspawn, scan_entries):
	Support the situation where ut_line is a 'char *' rather than a
	'char[]' of fixed size.  Likewise for ut_user and ut_host.
	(make_id_equals_comment): Likewise for ut_id.
	* src/pinky.c (print_entry):
	* src/who.c (print_user):
	Open /dev to simplify looking up its entries.
	Don’t use printf if the output might in theory be longer than INT_MAX.
	* src/pinky.c (scan_entries, short_pinky):
	* src/uptime.c (print_uptime, uptime):
	* src/users.c (list_entries_users, users):
	* src/who.c (who):
	Use idx_t where new read_utmp needs it.
	* src/system.h (STREQ_LEN): Add comment that last arg can be -1.

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

	uptime: fix Y5881633 bug
	* src/uptime.c (print_uptime): Prefer signed types.
	Fix unlikely bug on platforms with 32-bit long and 64-bit time_t
	if the idle time exceeds 2**31 days (about 6 million years...).

	pinky: fix "d" typo
	Problem reported by Bruno Haible (bug#65003).
	* src/pinky.c (idle_string): Fix recently-introduced typo:
	missing "d" for "days".

2023-08-01  Dragan Simic  <dsimic@manjaro.org>

	maint: minor comment cleanups
	* src/cut.c: Adjust a few comments slightly, simply to have their
	trailing whitespace the same as in the majority of the comments.

	cut: promptly diagnose write errors, continued
	* src/cut.c: Complete the error-handling improvements started in
	commit e0a4a60af5, by adding a couple of remaining checks for putchar().
	While there, sprinkle a few rather useful comments, and perform a few
	small code cleanups, to make the code and the comments more uniform
	and more conformant to the official coding style.  Also make the help
	message slightly more uniform.

	maint: reformat text width in HACKING
	* HACKING: Adjust line lengths.

2023-08-01  Pádraig Brady  <P@draigBrady.com>

	pinky: fix buffer size on 32 bit builds
	* src/pinky.c (idle_string): Use the correct buffer size
	following the recent int type adjustment.

	od: fix issues with recent format string changes
	* src/ioblksize.h: Avoid syntax check with redundant idx.h inclusion.
	* src/od.c (FMT_BYTES_ALLOCATED): Increase by two to avoid:
	  error: '%s' directive writing between 1 and 2 bytes into a region
	  of size between 1 and 4 [-Werror=format-overflow=]
	(maint): Use %td to print idx_t rather than invalid %jt format.

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

	pinky: prefer signed types
	* src/pinky.c (idle_string): Prefer intmax_t to unsigned long int;
	this avoids an overflow on platforms where unsigned long is 32
	bits and time_t is 64 bits (the bug could occur on such a system
	that was idle for more than 6 million years, so it’s a bit
	hard to supply a test case...).

	pathchk: prefer signed types
	* src/pathchk.c (validate_file_name): Prefer signed types.

	numfmt: prefer signed types
	* src/numfmt.c (suffix_power_char, powerld, expld)
	(simple_strtod_int, double_to_human, prepare_padded_number)
	(process_suffixed_number): Prefer signed types.
	(process_suffixed_number): Fix an unlikely bug if an
	arg has exactly 2**32 spaces at the start.

	mktemp,seq: prefer signed types
	* src/mktemp.c (main):
	* src/seq.c (main): Prefer signed types.

	kill: prefer signed types
	* src/kill.c (list_signals):
	Prefer signed types.  This avoids undefined behavior on
	theoretical platforms where unsigned and signed int have
	different representations.

	groups,id: don’t assume gid_t fits in unsigned long
	* src/group-list.c (print_group): Convert to intmax_t or
	uintmax_t, not to unsigned long.

	dircolors,du,expr: prefer signed types
	* src/dircolors.c (dc_parse_stream):
	* src/du.c (max_depth, main):
	* src/expr.c (main):
	Prefer signed types.

	od: prefer signed types
	* src/od.c: Include stdckdint.h.
	(bytes_to_oct_digits, bytes_to_signed_dec_digits)
	(bytes_to_unsigned_dec_digits, bytes_to_hex_digits):
	Use ‘char’ for these small constants.
	(simple_strtoi): Rename from simple_strtoul.  Convert to int
	instead of unsigned long; that’s good enough.  All uses changed.
	Simplify by using ckd_mul and ckd_add to check for overflow.
	(main): Prefer signed types to unsigned.

	cksum,df,digest: prefer signed types
	* src/cksum.c (main):
	* src/df.c (decode_output_arg):
	* src/digest.c (valid_digits):
	Prefer idx_t to unsigned types when the value is an index
	into an array.

	join: prefer signed types
	* src/join.c (struct outlist, struct field, struct line)
	(struct seq, autocount_1, autocount_2, join_field_1, join_field_2)
	(extract_field, keycmp, check_order, init_linep, free_spareline)
	(getseq, delseq, prfield, prfields, prjoin, join, add_field)
	(string_to_join_field, decode_field_spec, add_field_list)
	(set_join_field, main):
	Prefer signed integers to unsigned.

	factor: prefer signed types
	When it’s easy, prefer signed types to unsigned, as
	they are less confusing and allow overflow checking.
	* src/factor.c (struct mp_factors, udiv_qrnnd)
	(count_leading_zeros, count_trailing_zeros)
	(factor_insert_multiplicity, mp_factor_clear, mp_factor_insert)
	(factor_insert_refind, factor_using_division)
	(mp_factor_using_division, powm2, millerrabin, millerrabin2)
	(mp_millerrabin, prime_p, prime2_p, mp_prime_p, isqrt, isqrt2)
	(invtab, q_freq, factor_using_squfof, strto2uintmax)
	(print_factors_single, main):
	Prefer signed integers to unsigned.

	maint: include idx.h everywhere
	* src/system.h: Include idx.h here, instead of in every file
	that currently uses idx_t.  This should make it easier to use
	idx_t in the future.

2023-07-31  Paul Eggert  <eggert@cs.ucla.edu>

	who: fix only-theoretical overflow
	Change stzncpy’s implementation to match its comment, in the case
	where SRC + LEN would overflow.  This case never happens in coreutils.
	* src/system.h (stzncpy): Work even if SRC + LEN would overflow.

2023-07-31  Pádraig Brady  <P@draigBrady.com>

	tac: handle short reads on input
	This can be reproduced by getting the read() above 2G,
	which induces a short read, thus triggering the erroneous failure.

	  $ truncate -s 5G 5G

	  $ cat 5G | TMPDIR=$PWD tac | wc -c
	  tac: /tmp/tacFt7txA: read error: Illegal seek
	  0

	With the fix in place we now get:

	  $ cat 5G | TMPDIR=$PWD src/tac | wc -c
	  5368709120

	* src/tac.c (tac_seekable): Use full_read() to handle short reads.
	* NEWS: Mention the bug fix.
	Reported at https://bugs.debian.org/1042546

2023-07-31  Bruno Haible  <bruno@clisp.org>

	uptime: output correct user count on OpenBSD
	* src/uptime.c (print_uptime, uptime): Always call read_utmp
	and count the result.
	* NEWS: Mention the fix (text by Bruno Haible).

2023-07-31  Paul Eggert  <eggert@cs.ucla.edu>

	build: update gnulib submodule to latest

2023-07-30  Paul Eggert  <eggert@cs.ucla.edu>

	build: update gnulib submodule to latest
	* NEWS: Mention a bug that this fixes.

2023-07-22  Paul Eggert  <eggert@cs.ucla.edu>

	mv: better diagnostic for 'mv dir x' failure
	Problem reported by Nir Oren <https://bugs.gnu.org/64785>.
	* src/copy.c (copy_internal): Use a more-specific diagnostic when
	a rename fails due to a problem that must be due to the
	destination, avoiding user confusion in cases like 'mv dir x'
	where x is a nonempty directory.
	* tests/mv/dir2dir.sh: Adjust to match.

2023-07-20  Pádraig Brady  <P@draigBrady.com>

	doc: clarify tail -n/-c +NUM operation
	tail -n/-c +NUM, is different from tail -n/-c NUM,
	and head -n/-c NUM, and head -n/c -NUM, in that it
	specifies a 1 based index rather than a count to skip/include.
	So clarify this in tail --help and tail info manual.
	Note we also mention this gotcha at:
	https://www.pixelbeat.org/docs/coreutils-gotchas.html#tail

	* doc/coreutils.texi (tail invocation): Give examples for -c/-n +NUM,
	to make it clear one has to specify a number 1 larger than
	might be expected.
	* src/tail.c (usage): State the skip at start edge case more clearly
	in the -n description. -c is not often used with tail so we leave
	full explanation of that to the info manual.  Also split the string
	to simplify translation.

2023-07-18  Pádraig Brady  <P@draigBrady.com>

	maint: add a syntax check to prevent use of NULL
	* cfg.mk (sc_prohibit_NULL): Direct to use nullptr instead.

	tests: split: provide more isolated /tmp handling
	* tests/split/l-chunk.sh: Move the "expensive" portion to ...
	* tests/split/l-chunk-root.sh: .. A new test split from l-chunk.sh
	which uses an isolated TMPDIR, rather than exhausting /tmp,
	as that gives false positive failures with some other coreutils tests
	like tac-2-nonseekable.sh and shuf-reservoir.sh at least.
	* tests/local.mk: Reference the new test.

	split: honor $TMPDIR for temp files
	* bootstrap.conf: Depend on tmpdir rather than tmpfile,
	as the standard tmpfile() doesn't honor $TMPDIR.
	* src/split.c (copy_to_tmpfile): Adjust to call temp_stream() rather
	than tmpfile();
	* NEWS: Mention the improvement.

2023-07-18  Pádraig Brady  <P@draigBrady.com>

	tac: fall back to /tmp if $TMPDIR is unavailable
	This also refactors temp_stream() to its own module,
	in preparation for use by split.

	* src/tac.c: Refactor temp_stream() out to ...
	* src/temp-stream.c: ... A new module mostly refactored from tac,
	but uses tmpdir to more robustly support $TMPDIR,
	while falling back to /tmp if not available.
	* src/temp-stream.h: The new module interface.
	* src/local.mk: Reference the new module from tac.
	* tests/tac/tac.pl: Adjust to non failing missing $TMPDIR.
	* po/POTFILES.in: Reference the new module with translatable strings.
	* NEWS: Mention the user visible improvements to tac TMPDIR handling.

2023-07-18  Pádraig Brady  <P@draigBrady.com>

	maint: add syntax check to ensure safe mkstemp usage
	One needs to include stdlib--.h if using mkstemp()
	lest one hits esoteric bugs with closed stdin etc.

	* cfg.mk (sc_require_stdlib_safer): Add a new syntax check.
	(sc_require_stdio_safer): Fix this; broken since commit fa7ed969c3.

2023-07-17  Pádraig Brady  <P@draigBrady.com>

	join: promptly diagnose write errors
	* src/join.c (prjoin): Check for write errors after each line.
	* tests/misc/write-errors.sh: enable the test for join.
	* NEWS: Mention the improvement.

	comm: promptly diagnose write errors
	* src/comm.c (writeline): Simplify by removing the unneeded STREAM
	parameter.  Call write_error() upon ferror().
	(compare_files): Adjust to simplified writeline().
	* tests/misc/write-errors.sh: Enable comm test.
	* NEWS: Mention the improvement.

	cut: promptly diagnose write errors
	* src/cut.c (cut_bytes): Diagnose errors from fwrite() and putchar().
	(cut_fields): Likewise.
	* tests/misc/write-errors.sh: Enable the test for cut,
	and augment to cover both cut_bytes() and cut_fields().
	* NEWS: Mention the improvement.

	uniq: promptly diagnose write errors
	* src/uniq.c (write_line): Check the output from fwrite() immediately.
	(check_file): Likewise.
	* tests/misc/write-errors.sh: Enable the test case.
	* NEWS: Mention the improvement.

	od: promptly diagnose write errors
	* src/od.c (dump): Check for write errors after each block written,
	to exit early even with large / unbounded inputs.
	* tests/misc/write-errors.sh: enable od check.
	* NEWS: Mention the improvement.
	Fixes https://bugs.gnu.org/64540

	all: avoid repeated diagnostic upon write error
	* cfg.mk (sc_some_programs_must_avoid_exit_failure): Adjust to
	avoid false positive.
	(sc_prohibit_exit_write_error): A new syntax check to prohibit
	open coding error(..., "write error"); instead directing to use...
	* src/system.h (write_error): ... a new function to clear stdout errors
	before we explicitly diagnose a write error and exit.
	* src/basenc.c: Use write_error() to ensure no repeated diagnostics.
	* src/cat.c: Likewise.
	* src/expand.c: Likewise.
	* src/factor.c: Likewise.
	* src/paste.c: Likewise.
	* src/seq.c: Likewise.
	* src/shuf.c: Likewise.
	* src/split.c: Likewise.
	* src/tail.c: Likewise.
	* src/tr.c: Likewise.
	* src/unexpand.c: Likewise.
	* tests/misc/write-errors.sh: Remove TODOs for the fixed utilities:
	expand, factor, paste, shuf, tr, unexpand.

	tests: ensure utilties exit promptly upon write error
	* tests/local.mk: Reference the new test.
	* tests/misc/write-errors.sh: A new test to ensure utilities
	exit promptly upon writing to /dev/full.

2023-07-14  Jim Meyering  <meyering@meta.com>

	cksum: improve problematic_chars function
	* src/digest.c (problematic_chars): Implement using strcspn,
	and traversing S only once, rather than once per escaped byte.

2023-07-12  Pádraig Brady  <P@draigBrady.com>

	maint: give a new function the "pure" attribute
	* src/digest.c (problematic_chars): This recently introduced
	function does not modify state so is pure, even though GCC 13.1 at least
	did not warn about that attribute being appropriate.

2023-07-11  Pádraig Brady  <P@draigBrady.com>

	cksum: escape filenames with a leading '\' in --check status
	* src/digest.c (digest_check): Also escape in the case that the
	file name contains '\'.
	* tests/cksum/md5sum-bsd.sh: Add a test case.
	* doc/coreutils.texi (md5um invocation): Clarify escaping operation.
	* NEWS: Mention the bug fix.
	Fixes https://bugs.gnu.org/64392

2023-07-09  Pádraig Brady  <P@draigBrady.com>

	cksum: support transparent emulation of older utils
	Support -b, --binary, and -t, --text
	to allow full emulation of older utilities with:
	  exec cksum -a $algo --untagged "$@"
	Note this would diverge from OpenBSD's support of cksum -b.

	* src/digest.c: Change -b to mean --binary, not --base64 in all cases.
	Accept -b and -t in all cases.  Keep --binary and --text undocumented
	for cksum.
	* tests/cksum/cksum-base64.pl: s/-b/--base64/.
	* tests/cksum/cksum-a.sh: Ensure cksum supports -b and -t appropriately.
	* NEWS: Mention the change in behavior.

2023-07-08  Pádraig Brady  <P@draigBrady.com>

	maint: avoid static analysis failure for ignored dup2 return
	* src/sort.c: We're ignoring failures from these calls,
	so do so explicitly to avoid static analysis issues
	as reported by coverity.

2023-07-04  Sylvestre Ledru  <sylvestre@debian.org>

	tests: mktemp -t: $TMPDIR has higher priority than -p
	* tests/misc/mktemp.pl: Ensure that with -t,
	$TMPDIR has precedence over -p.

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

	maint: update .gitignore
	Add some newly-created Gnulib files,
	plus some bootstrap temporaries.

	stty: fix untranslated diagnostics
	* src/stty.c (set_speed): Translate diagnostics.

	maint: sync bootstrap from Gnulib
	* bootstrap: Copy from gnulib/build-aux/bootstrap.

	maint: prefer ckd_add to INT_ADD_WRAPV etc
	* bootstrap.conf (gnulib_modules): Add stdckdint.
	Also, in C source code, prefer C23 macros like ckd_add
	to their Gnulib near-equivalents like INT_ADD_WRAPV.
	Include <stdckdint.h> as needed.

	who: don’t crash if clock gyrates
	* src/who.c (idle_string): Avoid signed integer overflow
	if the superuser messes with the clock in bizarre ways.
	Remove an ‘assume’ that wasn’t correct under this scenario.

	df: omit GCC 5 ‘assume’s
	* src/df.c (main):
	* src/shred.c (dopass):
	Omit ‘assumes’ needed to pacify GCC 5 but not needed with GCC 13.

	maint: pacify GCC bug#109613 better
	* src/cut.c (cut_file):
	* src/nl.c (nl_file): Pacify GCC Bug#109613 in a better way, by
	narrowing the coverage of the ‘assume’ so that bugs in the
	no-longer-covered part are not masked.

	maint: stop pacifying Parfait
	* src/fmt.c (get_paragraph):
	* src/stty.c (display_changed, display_all): Omit calls to
	‘assume’ that are present only to pacify false positives by Parfait
	<https://labs.oracle.com/pls/apex/f?p=94065:12:17236785746387:13>,
	which went in-house in 2012 and never came back.

	build: update gnulib submodule to latest

	maint: go back to using ‘error’
	Now that Gnulib’s ‘error’ module does proper static checking
	for not returning, we need no longer use the ‘die’ macro.
	This makes code easier to read for people that are used to ‘error’.
	* cfg.mk (error_fns, exclude_file_name_regexp): Remove ‘die’.
	(sc_die_EXIT_FAILURE): Remove.
	* src/die.h: Remove.  All includes removed.  All calls to ‘die’
	changed back to calls to ‘error’.
	* src/install.c (get_ids): Use quoteaf (problem found with
	make syntax-check).
	* src/system.h: Include error.h, since some of our macros call ‘error’.
	Stop including error.h elsewhere.

	maint: improve static and dynamic checking
	This modernizes the source code somewhat, to take advantage
	of advances in GCC over the years, and Gnulib’s ‘assure’ module.
	Include assure.h in files that now need it.
	Do not include assert.h directly; it’s no longer needed.
	* bootstrap.conf (gnulib_modules): Add ‘assure’.
	* gl/lib/randread.c (randread_error):
	* src/chmod.c (describe_change):
	* src/chown-core.c (describe_change):
	* src/cp.c (decode_preserve_arg):
	* src/head.c (diagnose_copy_fd_failure):
	* src/ls.c (parse_ls_color):
	* src/od.c (decode_one_format):
	* src/split.c (main):
	* src/test.c (binary_operator, posixtest):
	Prefer affirm to abort, since it has better diagnostics in the
	normal case and better performance with -DNDEBUG.
	* gl/lib/xdectoint.c, src/die.h: Include stddef.h, for unreachable.
	* gl/lib/xdectoint.c: Do not include verify.h; no longer needed.
	* gl/lib/xdectoint.c (__xnumtoint):
	* src/die.h (die):
	Prefer C23 unreachable () to assume (false).
	* gl/lib/xfts.c (xfts_open):
	* src/basenc.c (base32hex_encode):
	* src/copy.c (abandon_move, copy_internal, valid_options):
	* src/cut.c (cut_fields):
	* src/df.c (alloc_field, decode_output_arg, get_dev):
	* src/du.c (process_file, main):
	* src/echo.c (usage):
	* src/factor.c (udiv_qrnnd, mod2, gcd2_odd, factor_insert_large)
	(mulredc2, factor_using_pollard_rho, isqrt2, div_smallq)
	(factor_using_squfof):
	* src/iopoll.c (iopoll_internal, fwrite_wait):
	* src/join.c (add_field):
	* src/ls.c (dev_ino_pop, main, gobble_file, sort_files):
	* src/mv.c (do_move):
	* src/od.c (decode_format_string, read_block, dump, main):
	* src/remove.c (rm):
	* src/rm.c (main):
	* src/sort.c (stream_open):
	* src/split.c (next_file_name, lines_chunk_split):
	* src/stdbuf.c (main):
	* src/stty.c (set_speed):
	* src/tac-pipe.c (line_ptr_decrement, line_ptr_increment):
	* src/touch.c (touch):
	* src/tr.c (find_bracketed_repeat, get_next)
	(validate_case_classes, get_spec_stats, string2_extend, main):
	* src/tsort.c (search_item, tsort):
	* src/wc.c (main):
	Prefer affirm to assert, as it allows for better static
	checking when compiling with -DNDEBUG.
	* src/chown-core.c (change_file_owner):
	* src/df.c (get_field_list):
	* src/expr.c (printv, null, tostring, toarith, eval2):
	* src/ls.c (time_type_to_statx, calc_req_mask, get_funky_string)
	(print_long_format):
	* src/numfmt.c (simple_strtod_fatal):
	* src/od.c (decode_one_format):
	* src/stty.c (mode_type_flag):
	* src/tail.c (xlseek):
	* src/tr.c (is_char_class_member, get_next, get_spec_stats)
	(string2_extend):
	Prefer unreachable () to abort () or assert (false) when merely
	pacifying the compiler, e.g., in a switch statement on an enum
	where all cases are covered.
	* src/copy.c (valid_options): Now returns void; the bool was useless.
	Caller no longer needs to assert.
	* src/csplit.c (find_line):
	* src/expand-common.c (next_file):
	* src/shred.c (incname):
	* src/sort.c (main):
	* src/tr.c (append_normal_char, append_range, append_char_class)
	(append_repeated_char, append_equiv_class):
	* src/tsort.c (search_item):
	Omit assert, since the hardware will check for us.
	* src/df.c (header_mode): Now the enum type it should have been.
	* src/du.c (process_file):
	* src/ls.c (assert_matching_dev_ino):
	* src/tail.c (valid_file_spec):
	* src/tr.c (validate_case_classes):
	Mark defns with MAYBE_UNUSED if they’re not used when -DNDEBUG.
	* src/factor.c (prime_p, prime2_p, mp_prime_p): Now ATTRIBUTE_PURE.
	Prefer affirm to error+abort.  No need to translate this diagnostic.
	* src/fmt.c (get_paragraph):
	* src/stty.c (display_changed, display_all, sane_mode):
	* src/who.c (idle_string):
	Prefer assume to assert, since the goal is merely pacification
	and assert doesn’t pacify anyway if -DNDEBUG is used.
	* src/join.c (decode_field_spec):
	Omit unreachable abort.
	* src/ls.c (assert_matching_dev_ino, main):
	* src/tr.c (get_next):
	Prefer assure to assert, since the check is relatively expensive
	and won’t help static analysis.
	* src/ls.c (main):
	Prefer static_assert to assert of a constant expression.
	(format_inode): Redo to make it clear that buflen doesn’t matter,
	and that buf must have a certain number of bytes.  All callers changed.
	This pacifies -Wformat-overflow.
	* src/od.c (decode_one_format):
	Omit an assert that tested for obviously undefined behavior,
	as the compiler could optimize it away anyway.
	* src/od.c (decode_one_format, decode_format_string):
	Prefer ATTRIBUTE_NONNULL to runtime checking.
	* src/stat.c: Do not include <stddef.h> since system.h does that now.
	* src/sync.c (sync_arg):
	Prefer unreachable () to assert (true), which was a typo.
	* src/system.h: Include stddef.h, for unreachable.
	* src/tail.c (xlseek): Simplify by relying on ‘error’ to exit.

	maint: fix indenting in previous change
	* src/ptx.c: Adjust to fit into 80 columns.

2023-06-29  Paul Eggert  <eggert@cs.ucla.edu>

	maint: prefer C23-style nullptr
	* bootstrap.conf (gnulib_modules): Add nullptr.
	In code, prefer nullptr to NULL where either will do.

2023-06-22  Bruno Haible  <bruno@clisp.org>

	build: ensure that makeinfo ≥ 6.8 checks the @menu structure
	See <https://lists.gnu.org/r/bug-texinfo/2023-06/msg00015.html>.

	* doc/local.mk (MAKEINFO): New variable.
	* cfg.mk (_makefile_at_at_check_exceptions): Update.

2023-06-22  Pádraig Brady  <P@draigBrady.com>

	b2sum: fix UAR with --check with malformed checksum lines
	* src/digest.c (split_3): Reinstate the check for whitespace after the
	digest portion of the line, so that we exit early before inspecting
	the file name which would be outside the passed buffer in the case
	where the input does not contain a newline.
	* tests/cksum/b2sum.sh: Add a test case.
	* NEWS: Mention the bug fix.
	* THANKS.in: Add Frank Busse who has reported multiple bugs using KLEE.
	Fixes https://bugs.gnu.org/64229

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

	maint: update GCC bug number in comment

2023-06-20  Paul Eggert  <eggert@cs.ucla.edu>

	doc: mention fix for bug#64123

	build: update gnulib submodule to latest

2023-06-19  Sylvestre Ledru  <sylvestre@debian.org>

	tests: move tests to a directory per utility
	* cfg.mk: Adjust syntax check exclusion paths.
	* tests/local.mk: Adjust for renamed tests.

2023-06-15  Pádraig Brady  <P@draigBrady.com>

	doc: mention cksum error fix with cpu feature checks changes
	* NEWS: Mention the error message to aid those searching
	for solutions to the issue, and mention cksum also
	as that was confirmed to fix the error with the adjusted
	cpu feature detection, as discussed at https://bugs.debian.org/1037264
	* src/cksum.c: Cleanup syntax-check failure from previous commit.

2023-06-14  Paul Eggert  <eggert@cs.ucla.edu>

	cksum,wc: clean up hw capability checking
	* src/cksum.c (cksum_pclmul) [!CRCTAB && !USE_PCLMUL_CRC32]:
	Remove macro.
	(cksum_fp): No longer file-scope.
	(pclmul_supported): Define only if USE_PCLMUL_CRC32.
	This omits the debug output "using generic hardware support"
	for simplicity and consistency with wc’s output.
	(crc_sum_stream) [!USE_PCLMUL_32]: No need for static function pointer.
	* src/wc.c (wc_lines_p) [USE_AVX2_WC_LINECOUNT]: No longer file-scope.
	(wc) [USE_AVX2_WC_LINECOUNT]: Check for avx2 support at most once,
	which was surely the code’s original intent.
	(wc) [!USE_AVX2_WC_LINECOUNT]: No need for static function pointer.

	cksum,wc: don’t include <cpuid.h>
	* src/cksum.c [!CRCTAB && USE_PCLMUL_CRC32]:
	* src/wc.c [USE_AVX2_WC_LINECOUNT]:
	Don’t include <cpuid.h>; no longer needed.

	cksum: fix bug in check for cksum_pclmul
	This fixes a typo in the previous patch.
	Problem reported by Pádraig Brady <https://bugs.gnu.org/64058#11>.
	* src/cksum.c (pclmul_supported): Also require AVX support
	to use cksum_pclmul.

	wc: port to kernels that disable XSAVE YMM
	Problem reported by Dave Hansen <https://bugs.gnu.org/64058>.
	Apply similar change to cksum and pclmul, too.
	* NEWS: Mention wc fix.
	* configure.ac (cpuid_exists, get_cpuid_count_exists):
	Remove.  All uses removed, since we no longer use __get_cpuid or
	__get_cpuid_count.
	(pclmul_intrinsic_exists, avx2_intrinsic_exists): Set to no if
	__builtin_cpu_supports calls cannot be compiled.
	(HAVE_PCLMUL_INTRINSIC, HAVE_AVX2_INTRINSIC): Remove; unused.
	Simplify surrounding code because of this.
	* src/cksum.c (pclmul_supported):
	* src/wc.c (avx2_supported):
	Use __builtin_cpu_supports instead of doing it by hand.
	Simplify surrounding code because of this.

2023-06-12  Ville Skyttä  <ville.skytta@iki.fi>

	dircolors: update list of backup file extensions
	* src/dircolors.hin: Sort backup section by extension.
	Treat .dpkg-new and .dpkg-tmp as backup files.
	Treat .crdownload (Chromium based browsers' partial download)
	as a backup file.

2023-06-11  Pádraig Brady  <P@draigBrady.com>

	dd: fix parsing of numbers with more than two multipliers
	* src/dd.c (parse_integer): Use recursion to support more than two
	multipliers.  Also protect suffix[-1] access to ensure we don't
	inspect before the passed string.
	* tests/dd/bytes.sh: Add test cases.
	* doc/coreutils.texi (dd invocation): Note the support for specifying
	many multipliers in a number.
	* NEWS: Mention the bug fix.
	Fixes https://bugs.debian.org/1037275

2023-06-09  Pádraig Brady  <P@draigBrady.com>

	build: update gnulib submodule to latest
	* gnulib: Update to latest.
	* po/POTFILES.in: Remove recent sc_po_check workaround.
	* tests/misc/date-debug.sh: Adjust as per spelling fix.

2023-06-08  Pádraig Brady  <P@draigBrady.com>

	doc: od --strings: clarify operation
	* doc/coreutils.texi (od invocation): Remove mention of ASCII,
	as all printable characters in unibyte locales are output.
	* src/od.c (usage): Clarify that only NUL terminated strings
	are displayed, and that it's printable chars, not only graphic chars
	that are output. I.e., spaces are output also if part of the string.
	Reported at https://bugs.ddebian.org/1037217

2023-06-07  Pádraig Brady  <P@draigBrady.com>

	maint: ls.c: update stale comment for previous commit
	* src/ls.c (gobble_file): Update comment to correspond with
	the changes in the previous commit.

	ls: display command line symlinks that return ELOOP
	* src/ls.c (gobble_file): Ensure we lstat() a symlink
	specified on the command line, if we receive ELOOP from stat().
	* tests/ls/symlink-loop.sh: Add a new test.
	* tests/local.mk: Reference the new test.
	* NEWS: Mention the bug fix.
	Fixes https://bugs.gnu.org/63931

	ls: use more standard symlink traversal
	* src/ls.c (gobble_file): stat() symlinks directly,
	rather than their targets.  This will be more consistent
	with how symlinks are generally accessed.
	(make_link_name): Remove no longer used function.
	Addresses https://bugs.gnu.org/63931

	doc: reference COPYING from README
	* README: Reference COPYING as per the GNU coding standards,
	and soon to be enforced with a syntax-check from gnulib.
