2019-03-10  Pádraig Brady  <P@draigBrady.com>

	version 8.31
	* NEWS: Record release date.

	tests: test-N: include subsecond values in gating check
	* tests/misc/test-N.sh: The subsecond values for atime and mtime
	were potentially seen to differ on newlyl created files.
	So we include the subsecond portion when comparing stat values.

2019-03-09  Pádraig Brady  <P@draigBrady.com>

	tests: wc-nbsp: fix false failures on various systems
	* tests/misc/wc-nbsp.sh: Add gating checks for all characters,
	as there are disparate classifications on various systems:
	SunOS 5.10 treats \u202F, \u2060 as !iswprint()
	SunOS 5.10 treats \u00A0, \u2007 as iswspace()
	AIX 7.2, Darwin 17.4.0, NetBSD 7.1 treat \u2060 as !iswprint()

2019-03-06  Pádraig Brady  <P@draigBrady.com>

	tests: tail-2/pipe-f: avoid false failure closing stdout
	* tests/tail-2/pipe-f.sh: Check closing stdout with >&-
	is effective, which avoids a false failure on NetBSD 7.1
	Reported by Assaf Gordon

	tests: tac-2-nonseekable: ensure we don't block indefinitely
	* tests/misc/tac-2-nonseekable.sh: Add a timeout to both
	protect and check whether we can close stdin correctly.

	tests: id/zero: avoid false failure due to sed differences
	* tests/id/zero.sh: sed on OSX will output a \n even
	if the input doesn't have a \n on the last "line".
	So ensure we always have a trailing '\n' to avoid the disparity.

2019-03-06  Pádraig Brady  <P@draigBrady.com>

	tests: test-N: fix false positives on some systems
	Testing by Assaf Gordon on OSX showed the atime wasn't
	being updated when explicitly set back in time.
	Also Debian 8.11 / mips64 was seen to not update the
	mtime when truncating an empty file.

	* tests/misc/test-N.sh: Isolate from different timestamping
	behaviors of various (file) systems, by correlating
	the timestamps with stat(1) before using `test -N`.

2019-03-06  Assaf Gordon  <assafgordon@gmail.com>

	doc: replace @hashchar{} with actual hash character
	Very old makeinfo-4.13 fails with:
	  ./doc/coreutils.texi:2286: Unknown command `hashchar'.
	  ./doc/coreutils.texi:2286: Misplaced {.
	  ./doc/coreutils.texi:2286: Misplaced }.

	Reported Bernhard Voelker in
	https://lists.gnu.org/r/coreutils/2019-03/msg00016.html .

	* doc/coreutils.texi (basenc invocation): Replace @hashchar{} with
	actual hash character.  The special syntax is only required
	when referring to #line directives.

2019-03-06  Pádraig Brady  <P@draigBrady.com>

	build: avoid statx related build failure on AIX
	* src/stat.c (get_birthtime): Check also for STATX_BTIME define,
	as a different statx is available on AIX 7.2.

	tests: wc-nbsp.sh: avoid failure on FreeBSD
	* tests/misc/wc-nbsp.sh: FreeBSD and OS X don't
	treat non breaking space as printable characters.
	So use wc -L to determine printability before
	testing non breaking space functionality.

	build: fix env build where SIGNUM_BOUND is not constant
	* src/env.c (initialize_signals): A new function to initialize
	the signals array on the heap, to avoid a build failure on
	opensolaris, where SIGNUM_BOUND is not a constant.

2019-03-04  Pádraig Brady  <P@draigBrady.com>

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

	build: revert recent change with distributed man page handling
	* man/local.mk: commit f114495e added an extra check to ensure
	a binary was working before using it to generate the man page.
	However this was not working for the false(1) command,
	and also one can generally specify that one should not
	be using generated commands on the current system by passing
	'cross_compiling=yes' to the configure invocation.

	env: add --list-signal-handling to output non default handling
	* src/env.c (main): Output blocked or ignored signals
	before a command is executed.
	* doc/coreutils.texi (env invocation): Add the option.
	* tests/misc/env-signal-handler.sh: Add a test case.
	* NEWS: Mention the new feature.

2019-03-04  Assaf Gordon  <assafgordon@gmail.com>

	env: new options --{default,ignore,block}-signal[=SIG]
	New options to set signal handlers for the command being executed.
	--block-signal suggested by Paul Eggert in http://bugs.gnu.org/34488#71
	--default-signal is useful to overcome the POSIX limitation that shell
	must not override inherited signal state, e.g. the second 'trap' here is
	a no-op:

	   trap '' PIPE && sh -c 'trap - PIPE ; seq inf | head -n1'

	Instead use:

	   trap '' PIPE && sh -c 'env --default-signal=PIPE seq inf | head -n1'

	Similarly, the following will prevent CTRL-C from terminating the
	program:

	   env --ignore-signal=INT seq inf > /dev/null

	See https://bugs.gnu.org/34488#8

	* NEWS: Mention new options.
	* doc/coreutils.texi (env invocation): Document new options.
	* man/env.x: Add example of --default-signal=SIG usage.
	(SEE ALSO): Mention sigprocmask.
	* src/env.c (signals): New global variable.
	(longopts): Add new options.
	(usage): Print new options.
	(parse_signal_params): Parse comma-separated list of signals, store in
	signals variable.
	(reset_signal_handlers): Set each signal to SIG_DFL/SIG_IGN.
	(parse_block_signal_params): Parse command-line options.
	(set_signal_proc_mask): Call sigprocmask to block/unblock signals.
	(main): Process new options.
	* src/local.mk (src_env_SOURCES): Add operand2sig.c.
	* tests/misc/env-signal-handler.sh: New test.
	* tests/local.mk (all_tests): Add new test.

2019-03-03  Martin Bukatovic  <martin.bukatovic@gmail.com>

	stat: print birth time on systems supporting statx
	* configure.ac: Check for statx(), available on glibc >= 2.28.
	* src/stat.c (get_birthtime): Call statx() when available.
	* NEWS: Mention the improvement.

2019-03-03  Pádraig Brady  <P@draigBrady.com>

	df: support different file system encodings when not using tty
	* src/df.c (replace_problematic_chars): A new wrapper to be
	more conservative in our replacement when not connected to a tty.
	* tests/df/problematic-chars.sh: Add a test case.

	maint: tidy up recent additions to NEWS
	* NEWS: Move date change to improvements and fix nohup grammar.

2019-02-27  Bernhard Voelker  <mail@bernhard-voelker.de>

	doc: further clarify 'yes' alternative in seq invocation
	* doc/coreutils.texi (node seq invocation): Clarify to use the tool
	'yes'; otherwise the reader may interpret the sentence as if one
	could pass 'yes' as the INCREMENT value.

2019-02-25  Pádraig Brady  <P@draigBrady.com>

	wc: treat non breaking space as a word separator
	* src/wc.c (iswnbspace): A new function to match
	characters in this class.
	(isnbspace): Likewise for single byte charsets.
	(main): Initialize posixly_correct from the environment,
	to allow disabling honoring NBSP in non C locales.
	(wc): Call is[w]nbspace() along with is[w]space.
	* bootstrap.conf: Ensure btowc is available.
	* tests/misc/wc-nbsp.sh: A new test.
	* tests/local.mk: Reference the new test.
	* NEWS: Mention the change in behavior.

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

	doc: more date +%F clarifications
	* doc/coreutils.texi (Date conversion specifiers):
	Plain %F is actually like %+4Y-%m-%d.
	(Padding and other flags): Mention POSIX restrictions.
	* src/date.c (usage): Document recent changes.

	doc: give date +%+F example
	* doc/coreutils.texi (Padding and other flags):
	Give example for + conversion specification.

	doc: fix typo in previous patch

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

	date: ‘+’ conversion specification flag
	The recent Gnulib update fixed Bug#34608; document and test this.
	* NEWS: Mention the change.
	* doc/coreutils.texi (Padding and other flags):
	Update doc to cover new flag and other POSIX.1-2017 changes.
	* tests/misc/date.pl (date-century-plus): New test.

	build: update gnulib submodule to latest

2019-02-24  Bernhard Voelker  <mail@bernhard-voelker.de>

	all: detect --help and --version more consistently
	For select programs which accept only --help and --version options
	(in addition to non-option arguments), process these options before
	any other options.

	Before:

	  $ dd bs=1 --help
	  dd: unrecognized option '--help'
	  Try 'dd --help' for more information.

	  $ yes me --help
	  me --help
	  me --help
	  ...

	After:
	Any occurrence of '--help' in the arguments (prior to '--') will
	show the help screen.

	Discussed in https://bugs.gnu.org/33468 .

	* NEWS: Mention change.
	* src/cksum.c, src/dd.c, src/hostid.c, src/hostname.c, src/link.c,
	src/logname.c, src/nohup.c, src/sleep.c, src/tsort.c, src/unlink.c,
	src/uptime.c, src/users.c, src/whoami.c, src/yes.c (main): Replace
	parse_long_options() + getopt_long() calls with
	parse_gnu_standard_options_only(); Remove <getopt.h> inclusion;
	Remove empty 'struct long_options' variable;
	* tests/misc/help-version-getopt.sh: Add test.
	* tests/local.mk (all_tests): Reference it.

2019-02-23  Pádraig Brady  <P@draigBrady.com>

	gnulib: update to the latest
	update to a version with parse_gnu_standard_options_only()

2019-02-19  Martin Castillo  <castilma@uni-bremen.de>

	doc: fix join examples in texinfo
	* doc/coreutils.texi (join invocation): Fix various errors.
	Fixes https://bugs.gnu.org/34583
	Fixes https://bugs.gnu.org/34584

2019-02-18  Daming Yang  <lion@aosc.io>

	ls: better align month abbreviations containing digits
	* src/ls.c (abmon_init): Align numeric abbreviations right.
	* NEWS: Mention the improvement.

2019-02-17  Pádraig Brady  <P@draigBrady.com>

	sort: clarify in --debug; only text comparisons affected
	* src/sort.c (main): Adjust the debug info regarding locales,
	to clarify that only textual comparisons are affected.
	* tests/misc/sort-debug-warn.sh: Adjust accordingly.
	Fixes https://bugs.gnu.org/34490

2019-02-11  Pádraig Brady  <P@draigBrady.com>

	comm,join: ensure warnings are apparent upon exit
	* src/comm.c (main): Output a warning right before exit,
	in case previous errors have scrolled from view.
	* src/join.c (main): Likewise.
	* tests/misc/comm.pl: Addjust accordingly.
	* tests/misc/join.pl: Likewise.
	Fixes https://bugs.gnu.org/34347

2019-02-11  Filipp Gunbin  <fgunbin@fastmail.fm>

	doc: fix typo referencing RFC 2822
	* doc/coreutils.texi (date invocation): s/822/2822/.
	Fixes https://bugs.gnu.org/34438

2019-02-10  Pádraig Brady  <P@draigBrady.com>

	gnulib: update to use new strtold module
	* gnulib: Update to make the new strtold module available.
	* bootstrap.conf: strtod is now a dependency of c-strtod,
	which in turn is a dependency of cl-strtod.  This treats
	strtold and strtod similarly.
	* gl/lib/cl-strtod.c: Adjust to assume strtold is available.
	* tests/misc/sort-float.sh: Likewise.
	* src/sort.c: Likewise.
	(nan_compare): Adjust comment to indicate
	we still have to init padding bits as per
	https://sourceware.org/bugzilla/show_bug.cgi?id=13246

2019-02-03  Pádraig Brady  <P@draigBrady.com>

	seq: output decimal points consistently with invalid locales
	* src/seq.c (print_numbers): Only reset the locale if it
	was successfully set originally.
	* tests/misc/seq-locale.sh: Add a new test.
	* tests/local.mk: Reference the new test.
	* NEWS: Mention the fix.

	build: ensure sys/select.h is included
	bootstrap.conf: Explicitly depend on select, rather than transitively.
	* src/tail.c: Unconditionally include select.h as we use select()
	outside inotify contexts now.

	stat,tail: fix android build and support inotify
	* src/extract-magic: Treat android like linux,
	which fixes the build by ensuring the constants are defined.
	* src/stat.c: Support all constants on android, including
	the android specific "sdcardfs".
	* src/tail.c: Fix inclusion of statfs headers to be independent
	of inotify availability, as fremote() is used on linux even
	if inotify has been disabled.  Also enable fremote() on android.
	* NEWS: Mention the improvment.
	Fixes https://bugs.gnu.org/34239

2019-01-30  Pádraig Brady  <P@draigBrady.com>

	tests: add test for locale decimal processing
	* tests/misc/sleep.sh: Check locale processing of printf, sleep,
	and timeout, when the french locale data is available.

2019-01-30  Pádraig Brady  <P@draigBrady.com>

	build: fix recent build failure on systems without strtold
	Recently introduced in commit v8.30-50-geb73e23

	* gl/lib/cl-strtod.c: Fall back to strtod() on systems
	without strtold() (like we already do in sort).

2019-01-27  Pádraig Brady  <P@draigBrady.com>

	maint: fix new syntax-check failure from recent change
	* cfg.mk: Exclude cl-strtold.c wrapper from requiring config.h

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

	printf,seq: remove c-strtod dependency
	* gl/modules/cl-strtold (Files): Add lib/cl-strtod.c, lib/cl-strtod.h.
	(Depends-on): Remove cl-strtod.
	(configure.ac): Redquire AC_C_RESTRICT.

	printf,seq: improve long double accuracy
	This fixes a thinko in the previous patch.
	* gl/lib/cl-strtod.c (STRTOD): New macro.
	(CL_STRTOD): Use it.

	printf,seq,sleep,tail,timeout: accept current-locale floats
	These commands now accept floating-point numbers in the
	current locale, as well as in the C locale.
	Compatibility problem reported by Robert Elz.
	* NEWS: Document this.
	* bootstrap.conf (gnulib_modules): Add cl-strtod, cl-strtold.
	Remove c-strtold.
	* doc/coreutils.texi (Floating point, tail invocation)
	(printf invocation, timeout invocation, sleep invocation)
	(seq invocation): Document this.
	* gl/lib/cl-strtod.c, gl/lib/cl-strtod.h, gl/lib/cl-strtold.c:
	* gl/modules/cl-strtod, gl/modules/cl-strtold: New files.
	* src/printf.c, src/seq.c, src/sleep.c, src/tail.c, src/timeout.c:
	Include cl-strtod.h instead of c-strtod.
	* src/printf.c (vstrtold):
	* src/seq.c (scan_arg, print_numbers):
	* src/sleep.c (main):
	* src/tail.c (parse_options):
	* src/timeout.c (parse_duration):
	Use cl_strtold instead of c_strtold.

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

	doc: update Goldberg URL
	* doc/coreutils.texi (Floating point): Update URL.

	sleep: improve doc
	Problem reported by Robert Elz.
	* doc/coreutils.texi (sleep invocation):
	Say that arguments must be non-negative, which means they cannot
	be arbitrary floating-point numbers.  Mention POSIX, not
	“historical implementations” that are no longer of practical
	interest.  List the extensions to POSIX.
	* src/sleep.c (usage): Omit needless words, removing dubious
	commentary about “most implementations” and incorrect commentary
	about “arbitrary”.  Details about exactly which numbers are
	allowed can be found in the documentation.

2019-01-20  Pádraig Brady  <P@draigBrady.com>

	tail: fix handling of broken pipes with SIGPIPE ignored
	* init.cfg (trap_sigpipe_or_skip_): A new function refactored from...
	* tests/misc/printf-surprise.sh: ...here.
	* tests/misc/seq-epipe.sh. Likewise.
	* src/tail.c (die_pipe): Ensure we exit upon sending SIGPIPE.
	* tests/tail-2/pipe-f.sh: Ensure we exit even if SIGPIPE is ignored.
	* NEWS: Mention the bug fix.

2019-01-20  Ayappan  <ayappap2@in.ibm.com>

	tail: fix recent ineffective AIX change
	* src/tail.c: Fix commit v8.30-40-gd5ab4cb which was ineffective.
	Fixes http://bugs.gnu.org/33946

2019-01-19  Pádraig Brady  <P@draigBrady.com>

	build: ensure VLAs are not used
	Fail developer builds if VLAs are used,
	as there are portability concerns to consider with them.

	* configure.ac: Enable -Wvla which is implicit in the full list added.
	* m4/jm-macros.m4: Define GNULIB_NO_VLA which disables use of
	VLAs within gnulib code.

2019-01-19  Pádraig Brady  <P@draigBrady.com>

	gnulib: update to the latest
	* gnulib: Update to a version supporting GNULIB_NO_VLA
	* bootstrap: Sync with latest

2019-01-15  Bernhard Voelker  <mail@bernhard-voelker.de>

	build: use distributed man pages when running with --help fails
	When building against an incompatible GLIBC version compared to that
	on the build host, then running the just-built binary might fail
	although it is the same platform - thus CROSS_COMPILING is false.
	As a result, generating the man pages fails.

	* man/local.mk (.x.1): Add a check to verify that running the utility
	with --help succeeds, otherwise falling back to using 'dummy-man'.

2019-01-12  Pádraig Brady  <P@draigBrady.com>

	ls: with --group-directories-first, also group symlinked dirs
	* src/ls.c (is_linked_directory): A new function to
	also consider symlinked directories.
	(main): Rename check_symlink_color to check_symlink_mode,
	and enable that with --group-directories-first.
	(DIRFIRST_CHECK): Adjust to use is_linked_directory,
	rather than just is_directory.
	(gobble_file): Simplify to always update f->linkmode
	if the stat() succeeds.
	* tests/ls/group-dirs.sh: A new test.
	* tests/local.mk: Reference the new test.
	* NEWS: Mention the change in behavior.
	Suggested by Amin Bandali in
	https://lists.gnu.org/r/coreutils/2018-12/msg00017.html

	tail: don't exit immediately with filters on AIX
	* src/tail.c: Fix the check_output_available check on AIX.
	Note we don't use poll for all systems as the overhead
	of adding the gnulib poll module wouldn't be worth it
	just for this single use.
	* tests/tail-2/pipe-f.sh: Fix the test which always passed
	due to only the exit code of sleep being checked.
	* NEWS: Mention the bug fix and rearrange alphabetically.
	Fixes http://bugs.gnu.org/33946

2019-01-05  Assaf Gordon  <assafgordon@gmail.com>

	basenc: allocate buffers on heap
	Allocate the encoding/decoding buffers dynamically on the heap instead
	of using variable-length-array (VLA) on the stack.
	Discussed in https://lists.gnu.org/r/coreutils/2019-01/msg00004.html .

	* src/basenc.c (do_encode,do_decode): Allocate inbuf/outbuf using
	xmalloc, and free if using LINT.

2019-01-04  Pádraig Brady  <P@draigBrady.com>

	doc: adjust URLs in help to avoid wrapping
	* src/system.h: Adjust lines containing URLs so that
	they don't wrap on 80 column terminals.  One could also
	use .UR macros, but these aren't universally available.
	Note the adjustments here need to be compatible with
	the pattern matching done in help2man.
	Addresses https://bugs.gnu.org/33914

2019-01-01  Assaf Gordon  <assafgordon@gmail.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.
	* tests/sample-test: Adjust to use the single most recent year.

2019-01-01  Bernhard Voelker  <mail@bernhard-voelker.de>

	maint: mention base32 in the title line of common basenc.c
	* src/basenc.c: Do the above, and remove a redundant comment.

2019-01-01  Assaf Gordon  <assafgordon@gmail.com>

	base64,base32: fix 'extra operand' error message
	In the following invocation, 'a' is the input file, and 'b' is the extra
	operand:

	  $ base64 a b

	Report 'b' in the error message instead of 'a':

	  $ base64 a b
	  base64: extra operand 'b'

	Discussed in https://lists.gnu.org/r/coreutils/2018-12/msg00008.html .

	* src/basenc.c (main): If there is more than one non-option operand,
	report the second one (assuming the first is a the input file name).
	* tests/misc/base64.pl: Add tests.
	* tests/misc/basenc.pl: Adjust expectedc error message in tests.
	* NEWS: Mention bugfix.

2018-12-31  Pádraig Brady  <P@draigBrady.com>

	doc: mention that more than 8 colors are supported by ls
	* src/dircolors.hin: Mention any codes supported by the terminal
	are allowed.
	Addresses https://bugs.gnu.org/33915

2018-12-27  Assaf Gordon  <assafgordon@gmail.com>

	basenc: A new program complementary to base64/base32
	Encodes/decodes data in various common formats:
	base64,base64url,base32,base32,base16,base2,z85.

	Discussed here:
	https://lists.gnu.org/r/coreutils/2018-11/msg00014.html
	https://lists.gnu.org/r/coreutils/2018-12/msg00019.html

	* AUTHORS: Add basenc.
	* README: Reference the new program.
	* NEWS: Mention the new program.
	* build-aux/gen-lists-of-programs.sh: Add basenc.
	* doc/coreutils.texi: (basenc invocation): Document the new command.
	* man/.gitignore: Ignore the generated man page.
	* man/basenc.x: A new template, with few examples.
	* man/local.mk: Reference the new man page.
	* scripts/git-hooks/commit-msg: Allow basenc as program prefix.
	* src/.gitignore: Ignore the new binary.
	* src/basenc.c:
	(usage): Mention new options.
	(main): Handle new options.
	(isbase*, base*_length, base*_encode, base*_decode_ctx): Implement new
	encoding/decoding formats.
	* src/local.mk: Add new program.
	* tests/local.mk: Add new test.
	* tests/misc/basenc.pl: New tests.
	* tests/misc/help-version.sh (basenc_setup): use '--version' for default
	invocation (basenc errors with no parameters).

2018-12-21  Assaf Gordon  <assafgordon@gmail.com>

	maint: rename base64.c to basenc.c
	In preparation for adding 'basenc' program.
	Suggested in https://lists.gnu.org/r/coreutils/2018-11/msg00019.html .

	* src/base64.c: Rename to src/basenc.c.
	* src/local.mk: Update base*_SOURCES definitions.
	* po/POTFILEs.in: Rename base64 to basenc.

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

	shred,sort,split: add NEWS item

	shred,sort,split: fix ftruncate error reporting
	Problem reported for split by Scott Worley (Bug#33761):
	* src/shred.c (do_wipefd):
	Also report an error if ftruncate fails	on a shared memory object.
	* src/sort.c (get_outstatus): New function.
	(stream_open, avoid_trashing_input): Use it.
	* src/sort.c (stream_open):
	* src/split.c (create):
	If ftruncate fails, do not report an error
	unless it is a regular file or a shared memory object.

2018-11-06  Bernhard Voelker  <mail@bernhard-voelker.de>

	sync: add NEWS and test for the fix in the previous commit
	* NEWS (Bug fixes): Mention the fix in commit 94d364f157f0.
	While at it, remove duplicate "Changes in behavior" heading.
	* tests/misc/sync.sh: Add a test with a write-only file for the fix.

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

	sync: fix open fallback bug
	Problem caught by Coverity Analysis
	and reported by Kamil Dudka (Bug#33287).
	* src/sync.c (sync_arg): Fix typo in fallback code.

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

	ln: use linkat and symlinkat
	Open a target directory and use its file descriptor in linkat,
	symlinkat, etc. syscalls, instead of constructing long file names
	by concatenating the target directory name to a basename.
	This avoids O(N²) behavior with ‘ln F1 F2 ... Fn DIR’ when DIR is
	a long file name with many slashes.  It also avoids some races if
	DIR is renamed while ln is running.
	* bootstrap.conf (gnulib_modules): Add openat-safer.
	* src/ln.c: Include fcntl-safer.h.
	(O_PATHSEARCH): New constant.
	(errno_nonexisting, target_directory_operand): Remove; no longer used.
	(atomic_link, do_link): New arg DESTDIR_FD.  All uses changed.
	(do_link): New arg DEST_BASE.  All uses changed.
	(main): Open target directory and use its file descriptor
	as DESTDIR_FD.

	build: update gnulib submodule to latest
	* src/copy.c (copy_internal):
	* src/cp.c (do_copy):
	* src/ln.c (do_link):
	Adjust to Gnulib API change.

2018-10-27  Bernhard Voelker  <mail@bernhard-voelker.de>

	tests: provide 100% coverage for echo
	*  src/echo.c (usage): Assert that STATUS is always EXIT_SUCCESS.
	* tests/misc/echo.sh: Add further tests for all hex and escape and
	escape characters.

	To get coverage statistics, run:
	  make coverage -j 4 TESTS=tests/misc/echo.sh SUBDIRS=.
	  xdg-open doc/coverage/src/echo.c.gcov.frameset.html

2018-10-27  Pádraig Brady  <P@draigBrady.com>

	echo: always process escapes when POSIXLY_CORRECT is set
	* src/echo.c (main): Always enable backslash processing if
	POSIXLY_CORRECT is set.
	* tests/misc/echo.sh: Add (the first) test for the echo command.
	* tests/local.mk: Reference the new test.
	* tests/misc/printf.sh: Update a stale comment.
	* doc/coreutils.texi (echo invocation). Mention that POSIXLY_CORRECT
	now always enables backslash processing.
	* NEWS: Mention the change in behavior.
	Fixes https://bugs.gnu.org/32703
	Issue identified by Eric Blake.

2018-10-26  Bernhard Voelker  <mail@bernhard-voelker.de>

	test: add -N unary operator
	Bash knows 'test -N FILE'.  Add it to GNU 'test' as well.

	* src/test.c (unary_operator): Add a case for 'N'.
	(usage): Document it.
	* doc/coreutils.texi (node File characteristic tests): Likewise.
	* NEWS (New features): Likewise.
	* tests/misc/test-N.sh: Add a test.
	* tests/local.mk (all_tests): Reference it.

2018-10-26  Bernhard Voelker  <mail@bernhard-voelker.de>

	test: simplify redundant code
	Remove the function 'test_unop', as the cases therein are redundant to
	those handled by 'unary_operator'; exception: the cases 'o' and 'N':
	they had been present in test_unop and handling the commands
	  test -N STR
	  test -o STR
	and
	  test x = x -a -N STR
	  test x = x -a -o STR
	which ran into an error later on anyway.
	With this commit, the error diagnostic will change from ...
	  $ /usr/bin/test -N STR
	  /usr/bin/test: extra argument '-N'
	  $ /usr/bin/test -o STR
	  /usr/bin/test: extra argument '-o'
	... to ...
	  $ src/test -N STR
	  src/test: '-N': unary operator expected
	  $ src/test -o STR
	  src/test: '-o': unary operator expected

	* src/test.c (test_unop): Remove.
	(unary_operator): Fail with test_syntax_error in the default case.
	(term): Directly call unary_operator.
	(two_arguments): Likewise.
	* tests/misc/test-diag.pl: Adjust error diagnostic.

2018-10-26  Bernhard Voelker  <mail@bernhard-voelker.de>

	test: remove support for the ambigous -a unary operator
	* src/test.c (unary_operator): Remove case 'a'.
	(test_unop): Likewise.
	* NEWS (Changes in behavior): Document the change.

	Discussed at https://bugs.gnu.org/33097

2018-10-21  Bernhard Voelker  <mail@bernhard-voelker.de>

	test: avoid FP in chroot-credentials.sh for different group list order
	On my openSUSE:Tumbleweed system, I get a false positive test failure
	in the above 'check-root' test because the group lists inside and
	outside the chroot have a different order:

	  ++ chroot --userspec=berny / id -G
	  ++ id -G berny
	  + test '100 454 457 480 492' = '100 480 492 457 454'
	  + fail=1

	* tests/misc/chroot-credentials.sh (num_sort): Add function to sort
	group lists, and use it in the test cases which test multiple groups.

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

	doc: tidy up setuid commentary
	* doc/perm.texi (Mode Structure): Improve wording.
	(Numeric Modes): Don’t say “on execution” (Bug#9594).

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

	ln: avoid directory hard-link races
	Previously, 'ln A B' did 'stat("B"), lstat("A"), link("A","B")'
	where the stat and lstat were necessary to avoid hard-linking
	directories on systems that can hard-link directories.
	Now, in situations that prohibit hard links to directories,
	'ln A B' merely does 'link("A","B")'.  The new behavior
	avoids some races and should be more efficient.
	This patch was inspired by Bug#10020, which was about 'ln'.
	* bootstrap.conf (gnulib_modules): Add unlinkdir.
	* src/force-link.c (force_linkat, force_symlinkat): New arg for
	error number of previous try.  Return error number, 0, or -1 if
	error, success, or success after removal.  All callers changed.
	* src/ln.c: Include priv-set.h, unlinkdir.h.
	(beware_hard_dir_link): New static var.
	(errnoize, atomic_link): New functions.
	(target_directory_operand): Use errnoize for simplicity.
	(do_link): New arg for error number of previous try.  All callers
	changed.  Do each link atomically if possible.
	(main): Do -r check earlier.  Remove linkdir privileges so we can
	use a single linkat/symlinkat instead of a racy substitute for the
	common case of 'ln A B' and 'ln -s A B'.  Set beware_hard_dir_link
	to disable this optimization.

	cp: 'cp -il A B' no longer fails if user OKs it
	* NEWS: Mention the change.
	* src/copy.c (copy_internal): Replace the link if the
	user has okayed it.

	build: update gnulib submodule to latest
	* gl/modules/tempname.diff: Update to match Gnulib.

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

	doc: add chmod examples
	Discussed in https://bugs.gnu.org/11043 .

	* doc/coreutils.texi (chmod invocation): Add examples.

2018-10-01  Bjarni Ingi Gislason  <bjarniig@rhi.hi.is>

	doc: fix minor mistakes in "env.x"
	* man/env.x (OPTIONS): Fix a spelling mistake.  Protect a period at the
	beginning of a line.

2018-09-29  Achilles Gaikwad  <agaikwad@redhat.com>

	id: support multiple specified users
	  $ id root nobody
	  uid=0(root) gid=0(root) groups=0(root)
	  uid=99(nobody) gid=99(nobody) groups=99(nobody)

	* src/id.c (main): Make variables opt_zero, just_group_list,
	just_group, use_real, just_user global to be used in a new
	function.
	(print_stuff): New function that will print user and group
	information for the specified USER.
	When using -G option delimit each record with two NULs.
	Restructure the code in the file to have global variables
	followed by functions.
	* tests/id/zero.sh: Add test cases to check the usage
	of -z option with multiple users.
	* tests/id/uid.sh: Add a test case to ensure all users
	are queried in the presence of errors.
	* doc/coreutils.texi: Document the interface changes.
	* NEWS: Mention the new feature.

2018-09-24  Stéphane Campinas  <stephane.campinas@gmail.com>

	doc: csplit: clarify handling of regexps with negative offsets
	* doc/coreutils.texi (csplit invocation): Detail the behavior
	with regexp patterns and negative offsets, which differs from
	line number patterns, to avoid looping on the input.  For example:
	  $ seq 50 | csplit -s - /15/-5 /12/
	  csplit: ‘/12/’: match not found

2018-09-23  Pádraig Brady  <P@draigBrady.com>

	doc: csplit: clarify input may not be reproducible from output
	* doc/coreutils.texi (csplit invocation): Clarify that
	portions of the input may be skipped and thus the input
	may not be reproducible by just concatenating the output files.
	Fixes https://bugs.gnu.org/32317

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

	df: omit redundant comparison
	Trivial inefficiency reported by Bruno Haible in:
	http://lists.gnu.org/r/bug-gnulib/2018-07/msg00109.html
	* src/df.c (hide_problematic_chars): Omit redundant test.

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

	df: tune slightly
	* src/df.c (get_header, get_dev):
	Avoid calling mbswidth twice when once will do.

	df: avoid multibyte character corruption on macOS
	This improves on the earlier fix for the problem reported by
	Chih-Hsuan Yen (Bug#32236), by also looking for other control
	characters and for encoding errors.
	* src/df.c: Include wchar.h and wctype.h instead of c-ctype.h.
	(hide_problematic_chars): Process the string as multibyte.
	Use iswcntrl, not c_iscntrl.

2018-07-26  Chih-Hsuan Yen  <yan12125@gmail.com>

	df: avoid multibyte character corruption on macOS
	* src/df.c (hide_problematic_chars): Use c_iscntrl() as
	passing 8 bit characters to iscntrl() is not supported on macOS.
	* NEWS: Mention the bug fix.
	Fixes https://bugs.gnu.org/32236

2018-07-22  Wodry  <coreutils3422@runbox.com>  (tiny change)

	doc: improve documentation of binary prefixes
	* doc/coreutils.texi (Common options):
	* src/dd.c, src/head.c, src/od.c, src/stdbuf.c, src/tail.c (usage):
	* src/system.h (emit_size_note):
	Mention binary prefixes (Bug#32242).

2018-07-21  Pádraig Brady  <P@draigBrady.com>

	tests: avoid false failure on sparc 32 bit
	* tests/rm/rm-readdir-fail.sh: Skip the test entirely on 32 bit,
	so we avoid conflating the 32bit and 64 bit types, as that
	triggers alignment issues (SIGBUS) on Gentoo sparc.
	Fixes https://bugs.gnu.org/29886

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

	build: update gnulib submodule to latest
	* bootstrap.conf, src/copy.c, src/mv.c, src/shred.c:
	Adjust to renaming of renameat2 to renameatu.

2018-07-04  Pádraig Brady  <P@draigBrady.com>

	tests: fix skipping in some tests
	* tests/cp/cp-a-selinux.sh: Use 'skip_' rather than the probably
	undefined 'skip'.
	* tests/du/2g.sh: Likewise.
	* tests/install/install-Z-selinux.sh: Likewise.
	* tests/misc/chcon.sh: Likewise.
	* tests/misc/selinux.sh: Likewise.
	* tests/mkdir/restorecon.sh: Likewise.
	* cfg.mk (sc_prohibit-skip): A new syntax check to catch the issue.

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

	maint: init.cfg: fix a minor test-related quoting bug
	* init.cfg (require_membership_in_two_groups_): This fixes a bug
	introduced by me in v8.15-8-gdd0e4c562.  Luckily, the consequence
	of low-probability triggering the bug was the mere added backslash
	in the diagnostic: "...but running id -G\ either...".  It would be
	triggered in a test failure for one who is a member of only one or
	fewer groups.

2018-07-01  Pádraig Brady  <P@draigBrady.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 8.30
	* NEWS: Record release date.

2018-06-30  Pádraig Brady  <P@draigBrady.com>

	tests: standardize perl usage in tests
	* tests/cp/fiemap-FMR.sh: Ensure perl is parameterized to $PERL,
	and ensure require_perl_ is used, so tests are skipped appropriately.
	* tests/cp/preserve-gid.sh: Likewise.
	* tests/du/long-from-unreadable.sh: Likewise.
	* tests/misc/env-S-script.sh: Likewise.
	* tests/misc/sort-benchmark-random.sh: Likewise.
	* tests/rm/deep-2.sh: Likewise.

	maint: copy: avoid new static analyzer warnings
	* src/copy.c (copy_internal): Use the lint protected src_mode,
	rather than accessing the src_sb again.  Also unconditionally
	populate src_sb when !x->move_mode and in lint mode.
	Reported by Kamil Dudka with coverity and clang analyzer.

	maint: fix recent stale comments and spelling mistakes
	* doc/coreutils.texi: s/seperator/separator/.
	* tests/misc/env-S.pl: Likewise.
	* src/env.c: Fix stale comment.

2018-06-27  Pádraig Brady  <P@draigBrady.com>

	maint: disable overly agressive sc_gitignore_redundant
	* cfg.mk (sc_gitignore_redundant): Disabled for now as too
	aggressive flagging entries like /lib/arg-nonnull.h in
	a newly checked out repo.

	env: adjust diagnostics provided for shebang usage
	* src/env.c (main): Don't process '-' specially since
	that causes an issue on the openbsd getopt implementation
	where a lone '-' is now processed as an option, and anyway
	it doesn't particuarly help diagnosing common shebang
	usage issues.  Also don't restrict the extra diagnostics
	for shebang usage to the case with 3 arguments, as
	further arguments can be passed to a script.
	* tests/misc/env-S.pl: Adjust accordingly.

2018-06-27  Assaf Gordon  <assafgordon@gmail.com>

	tests: accept getopt errors without single-quotes
	On OpenBSD 6.2, invalid single options produce error messages
	without single quotes:

	    $ ./src/chroot -/
	    chroot: unknown option -- /

	As opposed to other systems:

	    ./src/chroot: invalid option -- '/'

	Modify the grep search to accept this.

	* tests/misc/usage_vs_getopt.sh (checkprg): Change the grep pattern
	to accomodate no-single-quotes cases.

2018-06-27  Pádraig Brady  <P@draigBrady.com>

	tests: fix false failures when perl not available
	* tests/local.mk: Reference the stub that skips perl tests,
	with the correct path.

	tests: fix false failure with limited shebang lines
	* tests/misc/env-S-script.sh: Provide a wrapper to
	emulate shebang processing, but without length limits,
	which are 127 on Linux for example.

	maint: update gnulib to latest
	* gnulib: Update to latest, which incorporates
	a thread linking fix from Bruno Haible,
	which was seen on newer Ubuntu systems.

2018-06-27  Assaf Gordon  <assafgordon@gmail.com>

	tests: remove unused Data::Dumper perl module
	The module is not needed anymore (was used during development).
	Despite being a Perl core module, platforms like CentOS don't install
	it by default.  Reported by Bruno Haible at
	https://lists.gnu.org/r/coreutils/2018-06/msg00093.html.

	* tests/misc/csplit-suppress-matched.pl: Remove Data::Dumper.

2018-06-24  Carlos Santos  <casantos@datacom.com.br>

	maint: fix -Werror=suggest-attribute=malloc in expr.c
	Add attribute 'malloc' to mpz_get_str to prevent
	the following on GCC 8.1.1

	  src/expr.c:117:1: error: function might be candidate for attribute
	    'malloc' if it is known to return normally
	      [-Werror=suggest-attribute=malloc]
	   mpz_get_str (char const *str, int base, mpz_t z)
	   ^~~~~~~~~~~
	  cc1: all warnings being treated as errors

	* src/expr.c (mpz_get_str): Add _GL_ATTRIBUTE_MALLOC.

2018-06-24  Pádraig Brady  <P@draigBrady.com>

	maint: update gnulib to latest
	* gnulib: Update to latest.
	* .gitignore: Add new entries.
	* bootstrap.conf: Enable wchar-single, which will enable more
	efficient replacements of wcwidth and mbrtowc, as we indicate
	that the charset will no change between invocations of these functions.

	maint: sync longlong.h from gmp repo
	* src/longlong.h: Sync changes.  No functional change.

	maint: avoid false positive in src/fs-magic-compare
	* src/local.mk (fs_normalize_perl_subst): `make src/fs-magic-compare`
	was reporting incorrectly that AFS was not being handled.
	Add a mapping to our KAFS identifier.
	* .gitignore: Add intermediate files from `make src/fs-magic-compare`

2018-06-23  Bernhard Voelker  <mail@bernhard-voelker.de>

	tests: initialize fail=0 to avoid "unary operator expected" errors
	With an uninitialized variable 'fail', the unquoted use like
	  test $fail = 1
	lead to the shell error
	  "unary operator expected".
