2012-08-20  Jim Meyering  <meyering@redhat.com>

	version 8.19
	* NEWS: Record release date.

2012-08-19  Paul Eggert  <eggert@cs.ucla.edu>

	tests: port df/no-mtab-status to Solaris
	* tests/df/no-mtab-status: Include <mntent.h> in test program, so
	that the getmntent hack compilation fails on Solaris, as it
	should, since it's not compatible with Solaris.  Reported by
	Stefano Lattarini in <http://bugs.gnu.org/12225>.

2012-08-19  Jim Meyering  <meyering@redhat.com>

	tests: avoid split/filter test failure on very low-mem system
	* tests/split/filter: Use xz -1 when compressing, to minimize
	memory usage.  Otherwise, xz could fail due to insufficient
	virtual memory on a system with very little free memory.

2012-08-18  Jim Meyering  <meyering@redhat.com>

	tests: trigger the sort -u free-memory-read bug
	* tests/misc/sort-u-FMR: New file.
	* tests/Makefile.am (TESTS): Add it.
	* tests/misc/sort: Add the test here, too.
	* NEWS (Bug fixes): Mention it.

	tests: wrap the valgrind-requiring assertion in a function
	* tests/init.cfg (require_valgrind_): New function...
	* tests/misc/sort-stale-thread-mem: ...extracted from here.

2012-08-18  Paul Eggert  <eggert@cs.ucla.edu>

	sort: simpler fix for sort -u data-loss bug, and for a FMR bug
	This also fixes a free-memory-read (FMR) bug: when fillbuf's realloc
	of buf->buf frees the buffer into which saved_line.text points,
	the processing of that just-read longer line includes comparison
	against the saved line in freed memory.
	* src/sort.c (overlap): Remove.
	(fillbuf): Do not try to copy saved lines, as that is too risky
	in the presence of parallelism, reallocated buffers, etc.
	(sort): Invalidate any saved line before sorting a new batch.

2012-08-17  Jim Meyering  <meyering@redhat.com>

	sort: sort --unique (-u) could cause data loss
	sort -u could omit one or more lines of expected output.
	This bug arose because sort recorded the most recently printed line via
	reference, and if you were unlucky, the storage for that line would be
	reused (overwritten) as additional input was read into memory.  If you
	were doubly unlucky, the new value of the "saved" line would not only
	match the very next line, but if that next line were also the first in
	a series of identical, not-yet-printed lines, then the corrupted "saved"
	line value would result in the omission of all matching lines.

	* src/sort.c (saved_line): New static/global, renamed and moved from...
	(write_unique): ...here.  Old name was "saved", which was too generic
	for its new role as file-scoped global.
	(fillbuf): With --unique, when we're about to read into a buffer that
	overlaps the saved "preceding" line (saved_line), copy the line's .text
	member to a realloc'd-as-needed temporary buffer and adjust the line's
	key-defining members if they're set.
	(overlap): New function.
	* tests/misc/sort: New tests.
	* NEWS (Bug fixes): Mention it.
	* THANKS.in: Update.
	Bug introduced via commit v8.5-89-g9face83.
	Reported by Rasmus Borup Hansen in
	http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/23173/focus=24647

2012-08-16  Jim Meyering  <meyering@redhat.com>

	tests: reverse args in Coreutils.pm-invoked diff, for consistency
	* tests/Coreutils.pm (_compare_files): Reverse diff arguments so
	that we invoke diff -c $expected $actual, which is consistent with
	how init.sh-using tests invoke "compare exp out".

	maint: correct a stale comment in sort.c
	* src/sort.c (fillbuf): Fix comment typo.  x2nrealloc no longer
	doubles the size of its input buffer.

	maint: fix comment grammar to placate make syntax-check
	* src/remove.c (rm_fts): s/can not/cannot/

2012-08-14  Krzysztof Goj  <krzysztof.goj@gmail.com>

	rm: new option --dir (-d) to remove empty directories
	Add new option to rm (-d/--dir), which allows removal of
	empty directories, while still safely disallowing removal
	of non-empty ones.

	This improves compatibility with Mac OS X and BSD systems,
	which honor the -d option.

	* src/remove.c (rm_fts): Remove empty directories when requested.
	* src/remove.h (rm_options) [remove_empty_directories]: New member.
	* src/rm.c (long_opts, usage, main): Update usage and option parsing.
	(rm_option_init): Initialize the new member.
	* src/mv.c (rm_option_init): Initialize the new member.
	* tests/rm/d-1: New test case - successfully delete empty dir.
	* tests/rm/d-2: New test case - refuse to delete nonempty dir.
	* tests/Makefile.am (TESTS): Add them.

2012-08-14  Bernhard Voelker  <mail@bernhard-voelker.de>

	df: fail when the mount list is required but cannot be read
	* src/df.c (main): Add conditions to fail when the mount list cannot
	be read: this includes the cases when a file name argument is given
	and any of -a, -l, -t or -x is used.
	* doc/coreutils.texi: Document the additional error conditions.
	* tests/df/no-mtab-status: Add a new test.
	* tests/Makefile.am: Reference the new test.
	* NEWS: Mention the fix.

2012-08-12  Jim Meyering  <meyering@redhat.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.18
	* NEWS: Record release date.

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

	tests: fix validation of local file systems
	* tests/init.cfg (require_mount_list_): A new function
	to ensure we can read the list of file systems.
	(require_local_dir_): Call the above function, as otherwise
	the check is invalid.
	* tests/df/total-unprocessed: Ensure df can read the
	list of mounted file systems so that --local can be honored.

2012-08-06  Jim Meyering  <meyering@redhat.com>

	build: update gnulib submodule to latest

	tests: printf-surprise: avoid unwarranted failure on FreeBSD 9.0
	* tests/misc/printf-surprise: A VM size of 10,000KiB was too
	little in which to run "env printf ..." on FreeBSD 9.0-p3.
	Increase it to 15,000.

2012-08-05  Jim Meyering  <meyering@redhat.com>

	build: avoid sort link failure on Solaris 10
	* src/Makefile.am (sort_LDADD): Sort uses euidaccess, which may require
	whatever library configure deemed necessary to resolve the eaccess
	function, but no one told sort to link with that library.
	(sort_LDADD): Add $(LIB_EACCESS).

2012-08-04  Bernhard Voelker  <mail@bernhard-voelker.de>

	df: fix exit code and error messages with --total
	When the combination of the file system options with given files or
	devices does not lead to output, "df --total" would exit successfully
	although it should not.

	Examples:
	  $ df --total --type=xfs /          # when / is not an XFS file system
	  $ df --total --local -t nfs  DIR   # nfs is remote per se ...
	  $ df --total -t qwerty /dev/sdb5   # typo in file system type

	Furthermore, "df --total" would not print the error message "no file
	systems processed" when the file argument does not exist or is otherwise
	not accessible.

	Example:
	  $ df --total __not_exist__

	These 2 bugs are present since --total was added by commit
	v6.12-166-gea2887b.

	* src/df.c (get_dev): Do not set file_systems_processed to true when
	force_fsu is true, i.e. when the row for the "total" line is processed.
	(main): Don't print totals unless we've processed a file system.
	Also only print the "no FS processed" message if there was no
	preceding diagnostic.
	* tests/df/total-unprocessed: Add a new test.
	* tests/Makefile.am: Reference the new test.
	* NEWS: Mention the fix.

	Improved-by: Jim Meyering

2012-08-04  Jim Meyering  <meyering@redhat.com>

	truncate: don't leak a file descriptor with --ref=PIPE
	* src/truncate.c (main): For a user who makes the mistake of
	using a non-seekable file as a reference for the desired length,
	truncate would open that file, attempt to seek to its end, but
	upon seek failure would neglect to close the file descriptor.
	Close the file descriptor even when lseek fails.
	In addition, ignore failure to close that reference FD, since as
	long as the lseek succeeds, a close failure doesn't matter.
	Coverity spotted the potential FD leak.

	Improved-by: Pádraig Brady.

2012-08-04  Jim Meyering  <meyering@redhat.com>

	tests: avoid FP ulimit failure with valgrind-wrapped tools
	* tests/init.cfg (require_ulimit_): Raise VM limit from 10MiB to
	20MiB, to accommodate overhead of a valgrind-wrapped date program.
	Also declare this function's local variables "local".

2012-08-04  Jim Meyering  <meyering@redhat.com>

	split: plug nominal leaks
	* src/split.c (lines_rr) [IF_LINT]: Plug a harmless leak.
	(main) [IF_LINT]: Free a usually-small (~70KB) buffer
	just before exit, mainly to take this off the radar of
	leak-detecting tools.

	Improved-by: Pádraig Brady.

2012-08-03  Jim Meyering  <meyering@redhat.com>

	tail: avoid rare error-path FD leak
	* src/tail.c (tail_forever): Close FD to avoid leak after a
	failed fstat.

2012-07-27  Jim Meyering  <meyering@redhat.com>

	maint: refresh stale local gnulib patch files
	We carry local adjustments for a few gnulib modules via the
	patches in gl/.  Nearly all of those patches had become stale
	due to evolution of the originals in gnulib.

	To refresh them, first make sure you have no local changes in gl/
	or in the gnulib submodule, then run "make refresh-gnulib-patches".

2012-07-25  Jim Meyering  <meyering@redhat.com>

	tail: avoid misleading diagnostic upon fstat failure
	* src/tail.c (check_fspec): Save fstat-induced errno *before*
	calling close_fd, not after.  Otherwise, the close could well
	clobber the global errno, making tail print an invalid diagnostic.
	This could happen only with tail -f, and even then, only when
	a valid file descriptor were to provoke fstat failure.

2012-07-23  Pádraig Brady  <P@draigBrady.com>

	tests: add a test for a previously fixed output format bug in join
	Add a test and NEWS entry for a bug inadvertently fixed in
	a refactoring in commit v8.9-32-gd4db0cb

	* tests/misc/join (v2-format): Add a new test.
	* THANKS.in: Add the reporter.
	* NEWS: Mention the old bug.
	* cfg.mk (old_NEWS_hash): Update.

	Reported-by: Jean-Pierre Tosoni

2012-07-22  Pádraig Brady  <P@draigBrady.com>

	doc: mention gethostid(3) in hostid(1)
	* man/hostid.x: Add gethostid(3) to SEE ALSO section.
	Addresses http://bugs.gnu.org/12023

2012-07-22  Erik Auerswald  <auerswal@unix-ag.uni-kl.de>

	doc: mention uniq(1) in sort(1) man-page and vice versa
	* man/sort.x: Add SEE ALSO section with entry uniq(1).
	* man/uniq.x: Add sort(1) to SEE ALSO section.

2012-07-21  Jim Meyering  <meyering@redhat.com>

	maint: stzncpy: restrict pointer parameters
	* src/system.h (stzncpy): Add "restrict" attribute to each pointer
	parameter and note in the comment that the buffers must not overlap.

2012-07-20  Joachim Schmitz  <jojo@schmitz-digital.de>

	maint: rm: remove two more unused static inline functions
	* src/remove.c (cache_stat_ok, is_nondir_lstat): Remove unused
	functions.

2012-07-20  Jim Meyering  <meyering@redhat.com>

	maint: adjust exemption to track renamed test script
	* cfg.mk (exclude_file_name_regexp--sc_file_system): Sync this
	exemption regexp to match renamed tests/df/df-P.  This avoids
	a "make syntax-check" failure.

2012-07-20  Joachim Schmitz  <jojo@schmitz-digital.de>  (tiny change)

	maint: rm: remove unused static-inlined functions
	* src/remove.c (cache_statted, is_dir_lstat): Remove unused
	static-inlined functions.
	* THANKS.in: Remove my name from this list, now that (with this
	commit) it is included automatically.

2012-07-18  Andrew D Warshall  <warshall@99main.com>

	tests: fiemap-perf: avoid a false failure on ext2
	* tests/cp/fiemap-perf: Skip the test on ext2 file systems,
	as we do for ext3.  Also skip the test if we can't create
	a 1TiB file, which might not be supported on certain file systems.

2012-07-16  Pádraig Brady  <P@draigBrady.com>

	maint: move two df tests from tests/misc to tests/df
	* test/Makefile.am: Reference the moved tests.

2012-07-16  Pádraig Brady  <P@draigBrady.com>

	df: don't output control characters in a mount point name
	It's awkward to read and problematic for scripts when
	control characters like '\n' are output.

	Note other fields are already handled with mbsalign,
	which converts non printable chars to the replacement char.
	A caveat to note with that, is the replacement char takes
	a place in the field and so possibly truncates the field
	if it was the widest field in the records.

	Note a more general replacement function, that
	handles all printable, or non white space characters,
	would require more sophisticated support for various
	encodings, and the complexity vs benefit was not
	deemed beneficial enough at present.
	Perhaps in future a more general replacement function
	could be shared between the various utilities.

	Note <space> is unaffected in any field,
	which could impact scripts processing the output.
	However any of the number fields at least could have
	spaces considering `LANG=fr_FR df -B\'1`, so it's
	probably best to leave spaces, which also allows
	scripts to handle mount points with spaces without change.

	* src/df.c (hide_problematic_chars): Replace control chars with '?'.
	* tests/df/problematic-chars: Add a new root only test.
	* tests/Makefile.am: Reference the new test.
	* NEWS: Mention the fix.

2012-07-15  Jim Meyering  <meyering@redhat.com>

	pinky,who: fix bug in latest change
	* src/system.h (stzncpy): New function.
	* src/pinky.c (print_entry): Use stzncpy, not stpncpy.
	The latter does not NUL-terminate.  I assumed that strncpy was
	the only function with such a horrible API.  Today I learned that
	stpncpy also may not NUL-terminate its result.
	The bugs were introduced in commit v8.17-48-gf79263d.
	* src/who.c (print_user): Likewise.
	Thanks to Erik Auerswald for spotting my error.

	build: update gnulib submodule to latest

	maint: remove unwarranted uses of strncpy
	* src/pinky.c (print_entry): Remove unwarranted uses of strncpy.
	Instead, use stpcpy and stpncpy.
	* src/who.c (print_user): Likewise.
	* cfg.mk: Remove strncpy exemptions.

	build: shred.c: avoid i686-specific gcc -Wstrict-overflow warning
	* src/shred.c: Avoid gcc -Wstrict-overflow warning.
	Addresses http://bugs.gnu.org/11927

2012-07-13  Bruno Haible  <bruno@clisp.org>

	doc: clarify meaning of '-parodd' in stty help
	* src/stty.c (usage): Disambiguate explanation of -parodd.
	* THANKS.in: Add reporter.
	Reported by Michael Stummvoll

2012-07-13  Pádraig Brady  <P@draigBrady.com>

	doc: mention the improved sort memory allocation
	* NEWS: Mention the improvement.

2012-07-12  Stefano Lattarini  <stefano.lattarini@gmail.com>

	doc: fix errors and warnings with Texinfo 5
	Or rather, with the development version 4.13.90, which will eventually
	become Texinfo 5.0.

	* doc/coreutils.texi: Use '@item' instead of '@itemx' in several places,
	as Texinfo 5 refuses to process an '@itemx' that is not preceded by an
	'@item'.  Ensure that node extended names in menus and sectioning are
	consistent, and that ordering and presence of nodes in menus and in the
	actual text are consistent as well.

	Fixes http://bugs.gnu.org/11828

2012-07-11  Bernhard Voelker  <mail@bernhard-voelker.de>

	df: warn if soon-to-be-removed --megabyte option is used
	* src/df.c (MEGABYTES_OPTION): Add enum and mark it for removal
	in August 2013.
	(long_options): Use MEGABYTES_OPTION for --megabytes option.
	(main): Add a case for it and issue a deprecation warning if
	the long form is used.  Document the short -m option to
	exist only for BSD compatibility.

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

	sort: by default, do not exceed 3/4 of physical memory
	* src/sort.c (default_sort_size): Do not exceed 3/4 of total memory.
	See Jeff Janes's bug report in
	<http://lists.gnu.org/archive/html/coreutils/2012-06/msg00018.html>.

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

	tests: sort-merge-fdlimit: reduce the limit by one
	* tests/misc/sort-merge-fdlimit: As a consequence of commit
	v8.17-34-g59daf05, we can reduce the descriptor limit by one.

2012-07-06  Paul Eggert  <eggert@cs.ucla.edu>

	doc: document leap seconds better
	* doc/coreutils.texi (touch invocation, Time conversion specifiers)
	(Options for date, Examples of date): Index "leap seconds" and
	improve their documentation a bit.

	doc: fix spacing
	* doc/coreutils.texi: Use right amount of spacing after punctuation.

2012-07-04  Jim Meyering  <meyering@redhat.com>

	date: fails to diagnose invalid input
	date -d "$(printf '\xb0')" would print 00:00:00 with today's date
	rather than diagnosing the invalid input.  Now it reports this:
	date: invalid date '\260'
	* gnulib: Update submodule to latest for fixed parse-datetime.y.
	* tests/misc/date [invalid-high-bit-set]: New test.
	* NEWS (Bug fixes): Mention it.
	* bootstrap, tests/init.sh: Also update to latest.
	Reported by Peter Evans in http://bugs.gnu.org/11843

2012-07-03  Jim Meyering  <meyering@redhat.com>

	maint: add syntax-check rule to help avoid misuse of EXIT_FAILURE
	* cfg.mk (sc_some_programs_must_avoid_exit_failure): New rule,
	to help us avoid using EXIT_FAILURE in programs like sort, ls, nohup,
	timeout, env, etc. that use different exit codes in many cases.

	maint: fix minor bugs in helper program, setuidgid
	* src/setuidgid.c (main): Fix two error-before-usage calls not to exit.
	Exit with status SETUIDGID_FAILURE (not EXIT_FAILURE) consistently.

2012-07-03  Paul Eggert  <eggert@cs.ucla.edu>

	sort: fix exit-status typo
	* src/sort.c (stream_open): EXIT_FAILURE -> SORT_FAILURE.
	Suggested by Pádraig Brady in <http://bugs.gnu.org/11816#34>.

	sort: simplify -o handling to avoid fdopen, assert
	* src/sort.c (outfd): Remove.  All uses replaced by STDOUT_FILENO.
	(stream_open): When writing, use stdout rather than fdopen.
	(move_fd_or_die): Renamed from dup2_or_die, with the added functionality
	of closing its first argument.  All uses changed.
	(avoid_trashing_input): Special case for !outfile no longer needed.
	(check_output): Arrange for standard output to go to the file,
	rather than storing the fd in outfd.

2012-07-02  Pádraig Brady  <P@draigBrady.com>

	sort: avoid redundant processing with inaccessible inputs or output
	* src/sort.c (check_inputs): A new function to verify all inputs
	are accessible before further processing.
	(check_output): A new function to open or create a specified
	output file, before futher processing.
	(stream_open): Adjust to truncating the previously opened
	output file rather than opening directly.
	(avoid_trashing_input): Optimize to stat the output file
	descriptor, rather than the file name.
	(main): Call the new functions to check accessibility of
	inputs and output, before processing starts.
	* tests/misc/sort: Adjust to the changed error message.
	* tests/misc/sort-merge-fdlimit: Account for the earlier opened
	file descriptor of the specified output file.
	* tests/misc/sort-exit-early: A new test to exercise the improvements.
	* tests/Makefile.am: Reference the new test.
	* NEWS: Mention the improvement.

	Suggested-by: Bernhard Voelker

2012-07-02  Pádraig Brady  <P@draigBrady.com>

	maint: sc_prohibit_fail_0: update a stale comment
	* cfg.mk (sc_prohibit_fail_0): Following on from
	commit v8.0-79-g71c2f88, update the comment to match.

	maint: avoid a -Wunsed-but-set warning on some systems
	* src/stty.c (main): Mark speed_was_set as possibly unused,
	as is the case when CIBAUD is undefined (on ppc64 GNU/Linux
	for example).
	Reported-by: Stefano Lattarini

2012-06-30  Jim Meyering  <meyering@redhat.com>

	maint: avoid false-positive syntax-check failure due to fail=0 in .texi
	* cfg.mk (exclude_file_name_regexp--sc_prohibit_fail_0): Exempt
	all .texi files.

	stat,tail: recognize new file system type: aufs
	* src/stat.c (human_fstype) [__linux__]: Add a 'case' for the new
	remote file system type: aufs (0x61756673).
	* NEWS (New features): Mention stat -f.
	(Bug fixes): Mention it for tail -f.
	Reported by Michael Mol in http://bugs.gnu.org/11823

2012-06-30  Jim Meyering  <meyering@redhat.com>

	doc: improve sample backup script
	* doc/coreutils.texi (cp invocation): Make the backup script exit
	with an accurate reflection of any failure.
	Also, add --preserve=all.

	Improved-by: Bernhard Voelker

2012-06-26  Pádraig Brady  <P@draigBrady.com>

	maint: avoid a static analysis warning in csplit
	The Canalyze static code analyzer correctly surmised
	that there is a use-after-free bug in free_buffer()
	at the line "struct line *n = l->next", if that
	function is called multiple times.

	This is not a runtime issue since a list of lines
	will not be present in the !lines_found case.

	* src/csplit.c (free_buffer): Set list head to NULL so
	that this function can be called multiple times.
	(load_buffer): Remove a redundant call to free_buffer().

	Reported-by: Xu Zhongxing

2012-06-22  Bernhard Voelker  <mail@bernhard-voelker.de>

	doc: document multiplier for dd number options like count=N
	* src/dd.c (usage): Add "N" to the description of multipliers.
	* doc/coreutils.texi (dd invocation): Likewise.

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

	split: ensure output doesn't overwrite input
	* src/split.c (create): Check if output file is the
	same inode as the input file.
	* tests/split/guard-input: New test case.
	* tests/Makefile.am: Reference new test case.
	* NEWS: Mention the fix.

	Improved-by: Jim Meyering
	Reported-by: François Pinard

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

	maint: refactor common mode bits used to create files
	* src/system.h (MODE_RW_UGO): The new refactored define (666).
	* src/mkfifo.c: Use the new define.
	* src/mknod.c: Likewise.
	* src/split.c: Likewise.
	* src/system.h: Likewise.
	* src/touch.c: Likewise.
	* src/truncate.c: Likewise.

	Suggested-by: Jim Meyering

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

	maint: suppress echoing of sc_THANKS_in_duplicates implementation
	* cfg.mk (sc_THANKS_in_duplicates): Suppress the echoing of these
	commands run during `make syntax-check`

2012-06-20  Bernhard Voelker  <mail@bernhard-voelker.de>

	maint: sort: style adjustment to help clarify size determination
	* src/sort.c (default_sort_size): Move physmem code "down" to first use.

2012-06-12  Jim Meyering  <meyering@redhat.com>

	stty: portability: accommodate CIL
	* src/stty.c (main): Declare locals "mode" and "new_mode" to be static
	to ensure that each is initialized to zero, *including* all padding.
	While gcc clears padding of a local automatic initialized to "{ 0, }",
	CIL does not, and the C99 standard is not clear on this issue.
	Reported by Edward Schwartz.  See http://bugs.gnu.org/11675 for details.

2012-06-10  Sami Kerola  <kerolasa@iki.fi>

	maint: remove su testing artifact
	* tests/misc/help-version: Remove expected su exit code.

2012-06-10  Jim Meyering  <meyering@redhat.com>

	build: update gnulib to latest; correct comment grammar
	* tests/misc/help-version: Fix comment grammar:
	s/all these/all of these/
	* gl/lib/tempname.c.diff: Likewise.

	maint: migrate strncpy-prohibiting rule to gnulib
	* cfg.mk (sc_prohibit_strncpy): Remove rule.
	Now it's in gnulib.

	maint: prohibit use of strncpy
	* cfg.mk (sc_prohibit_strncpy): New syntax-check rule.
	Exempt pinky.c and who.c, at least for now.

2012-06-06  Jim Meyering  <meyering@redhat.com>

	su: remove program (util-linux is now the best source for it)
	* README: Omit "su" from list of programs.
	* src/su.c: Remove file.
	* src/Makefile.am: Remove su-related rules and variables.
	* tests/misc/su-fail: Remove test.
	* tests/Makefile.am (TESTS): Remove misc/su-fail.
	* tests/misc/invalid-opt: Remove su-related code.
	* src/.gitignore: Remove su.
	* man/su.x: Remove file.
	* man/Makefile.am (su.1): Remove rule.
	* po/POTFILES.in: Remove su.c from the list.
	* TODO: Remove ancient entry.
	* NEWS (Changes in behavior): Mention it.
	* doc/coreutils.texi: Remove su-related description.
	* AUTHORS: Remove su.
	* m4/lib-check.m4 (cu_LIB_CHECK): Remove file/macro.
	* configure.ac: Remove su-related code and sole use of cu_LIB_CHECK.
	* scripts/git-hooks/commit-msg: Remove su from this list, too.

	maint: detect a new type of duplicate in THANKS.in
	* cfg.mk (sc_THANKS_in_duplicates): New rule.

2012-06-05  Jim Meyering  <meyering@redhat.com>

	maint: mark new diagnostic for translation
	* src/head.c (elide_tail_lines_seekable): Mark new diagnostic.
	I will look at the results of "make syntax-check", I will look...

2012-06-05  Jim Meyering  <meyering@redhat.com>

	head: with --lines=-N (-n-N) reset file pointer on seekable input
	* src/head.c (elide_tail_lines_seekable): Reset file pointer
	after printing up to an end-relative line-counted offset.
	Anoop Sharma reported the problem and suggested the fix.
	* tests/misc/head-pos: Add coverage via a very similar, existing test.
	Also add coverage for a previously untested block of code.
	* tests/misc/head-elide-tail ($READ_BUFSIZE): Update to 8192, to
	match the value of BUFSIZ I see today on Fedora 17/x86_64 (unrelated
	to this fix).
	* NEWS (Bug fixes): Mention it.

	Improved-by: Pádraig Brady

2012-06-01  Jim Meyering  <meyering@redhat.com>

	stat,tail: recognize new file system type: panfs
	* src/stat.c (human_fstype) [__linux__]: Add a 'case' for the new
	remote file system type: panfs (0xAAD7AAEA).
	* NEWS (New features): Mention stat -f.
	(Bug fixes): Mention it for tail -f.
	Reported by Travis Gummels in http://bugzilla.redhat.com/827199

2012-05-31  Jim Meyering  <meyering@redhat.com>

	maint: fix typos in test comments and old ChangeLog files
	Culprits identified and fixed automatically using these commands:
	git ls-files|misspellings -f -|perl -nl \
	  -e '/^(.*?)\[(\d+)\]: (\w+) -> "(.*?)"$/ or next;' \
	  -e '($file,$n,$l,$r)=($1,$2,$3,$4); $q="'\''"; $r=~s/$q/$q\\$q$q/g;'\
	  -e 'print "sed -i $q${n}s!$l!$r!$q $file"' | bash
	using http://github.com/lyda/misspell-check
	* old/fileutils/ChangeLog: Fix typos.
	* old/textutils/ChangeLog: Likewise.
	* tests/misc/truncate-fail-diag: Likewise.

2012-05-28  Pádraig Brady  <P@draigBrady.com>

	cksum: line-buffer the printed checksums
	This utility was inadvertently omitted from commit v8.0-34-g710fe41
	* src/cksum.c (main): Set stdout to line buffered mode, to ensure
	parallel running instances don't intersperse their output.
	* NEWS: Mention the fix.
	* THANKS.in: Add Anoop.
	Reported by Anoop Sharma.

2012-05-21  Jim Meyering  <meyering@redhat.com>

	maint: remove comment that suggested to remove support for mktemp -V
	* src/mktemp.c (main): Don't suggest to remove support for -V, an
	undocumented alias for --version, since that would introduce a
	gratuitous incompatibility with the original mktemp program.

2012-05-21  Mike Frysinger  <vapier@gentoo.org>

	dircolors: add st/st-256color terminal types
	See http://st.suckless.org/
	* src/dircolors.hin: Add st and st-256color.
	Reported-by: Jeroen Roovers <jer@gentoo.org>, via
	Mike Frysinger <vapier@gentoo.org> in http://bugs.gnu.org/11498

2012-05-20  Jim Meyering  <meyering@redhat.com>

	id,groups: use gidtostr/uidtostr to avoid casts
	* src/id.c (gidtostr, uidtostr): Define macros.
	(gidtostr_ptr, uidtostr_ptr): Define safer functions.
	Use gidtostr and uidtostr to print GID and UID without
	need/risk of casts.
	* src/group-list.c: Likewise.

2012-05-16  Jim Meyering  <meyering@redhat.com>

	tests: use $AWK, not awk
	* tests/cp/sparse-fiemap: Don't hard-code "awk".  Use $AWK.
	* tests/init.cfg: Likewise.
	* tests/misc/sort-rand: Likewise.

	maint: tell xgettext that fputs arg "93% of..." is not a C format string
	* src/fmt.c (usage): Add a comment to tell
	xgettext that the "% o" in fputs argument string of "...93% of..."
	is not a C format string.  Reported by Toomas Soome, Göran Uddeborg,
	Petr Pisar, Primoz PETERLIN and Chusslove Illich via
	http://bugs.gnu.org/11470

	maint: add assertions to placate static analysis tools
	A static analysis tool (http://labs.oracle.com/projects/parfait/)
	produced some false positive diagnostics.  Add assertions to help
	it understand that the code is correct.
	* src/stty.c: Include <assert.h>.
	(display_changed): Add an assertion to placate parfait.
	(display_all): Likewise.
	* src/sort.c: Include <assert.h>.
	(main): Add an assertion to placate parfait.
	* src/fmt.c: Include <assert.h>.
	(get_paragraph): Add an assertion to placate parfait.

2012-05-16  Pádraig Brady  <P@draigBrady.com>

	stat: report the correct block size for file system usage
	struct statfs has the f_frsize member since Linux 2.6,
	so use that rather than f_bsize which can be different.
	Note the related df change mentioned in NEWS is handled
	in gnulib by using statvfs() rather than statfs()
	on Linux > 2.6.36 (where statvfs doesn't hang) and the
	same method as stat for Linux 2.6 kernels earlier than that.
	stat(1) doesn't use statvfs() on GNU/Linux as the f_type
	member isn't available there.
	Note the change to not use statvfs() on GNU/Linux was introduced
	in gnulib commit eda39b8 16-08-2003.

	* m4/stat-prog.m4 (cu_PREREQ_STAT_PROG): Check for the f_frsize
	member in the statfs structure.
	* src/stat.c: Use (struct statfs).f_frsize if available.
	* NEWS (Bug fixes): Mention this stat fix, and the related df fix
	coming in the next gnulib update.
	* THANKS.in: Add Nikolaus.

	Reported and Tested by Nikolaus Rath

2012-05-12  Jim Meyering  <meyering@redhat.com>

	ls: color each symlink-to-relative-name in / properly
	In order for ls --color to color each symlink, it must form the name
	of each referent and then stat it to see if the link is dangling, to
	a directory, to a file, etc.  When the symlink is to a relative name,
	ls must concatenate the starting directory name and that relative name.
	When, in addition, the starting directory was "/" or "/some-name",
	the result was ill-formed, and the subsequent stat would usually fail,
	making the caller color it as a dangling symlink.
	* src/ls.c (make_link_name): Don't botch the case in which
	dir_name(NAME) == "/" and LINKNAME is relative.
	* tests/ls/root-rel-symlink-color: New file.  Test for the above.
	* tests/Makefile.am (TESTS): Add it.
	* NEWS (Bug fixes): Mention it.
	Reported by Mike Frysinger in http://bugs.gnu.org/11453
	Bug introduced by commit v8.16-23-gbcb9078.

2012-05-10  Jim Meyering  <meyering@redhat.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.17
	* NEWS: Record release date.

	tests: misc/tty-eof: increase timeout to avoid unwarranted failure
	* tests/misc/tty-eof: Increase timeout from 1s to 10s, to avoid
	unwarranted failure under heavy load.
	* tests/Makefile.am (TESTS): Move misc/tty-eof "up" to nearer the
	beginning of the list (from near the middle) so that it is started
	earlier in parallel test runs.  Otherwise, it would frequently be
	among the last two tests to complete.

	stat,tail: recognize new FS types: bdevfs, inodefs, qnx6
	* src/stat.c (human_fstype) [__linux__]: Add 'case's for these local
	file system types: bdevfs (0x62646576), inodefs (0x42494E4D),
	qnx6 (0x68191122).
	Now that the kernel has a name for S_MAGIC_BINFMTFS, use
	theirs in place of our S_MAGIC_BINFMT_MISC.
	* NEWS (New features): Mention it.

	scripts: encourage use of shorter "bugs.gnu.org" in bug URLs
	* scripts/git-hooks/commit-msg: Also ding debbugs.gnu.org URLs.

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

	maint: handle file sizes more reliably
	Problem reported by Samuel Thibault in <http://bugs.gnu.org/11424>.
	* NEWS: Document this.
	* src/dd.c (skip): Handle skipping past EOF on shared or typed
	memory objects the same way as with regular files.
	(dd_copy): It's OK to truncate shared memory objects.
	* src/du.c (duinfo_add): Check for overflow.
	(print_only_size): Report overflow.
	(process_file): Ignore negative file sizes in the --apparent-size case.
	* src/od.c (skip): Fix comment about st_size.
	* src/split.c (main):
	* src/truncate.c (do_ftruncate, main):
	On files where st_size is not portable, fall back on using lseek
	with SEEK_END to determine the size.  Although strictly speaking
	POSIX says the behavior is implementation-defined, in practice
	if lseek returns a nonnegative value it's a reasonable one to
	use for the file size.
	* src/system.h (usable_st_size): Symlinks have reliable st_size too.
	* tests/misc/truncate-dir-fail: Don't assume that getting the size
	of a dir is not allowed, as it's now allowed on many platforms,
	e.g., GNU/Linux.

	stat: don't report negative file size as huge positive number
	* src/stat.c (print_stat): Use out_int, not out_uint for stat.st_size.
	* NEWS (Bug fixes): Mention it.

2012-05-08  Jim Meyering  <meyering@redhat.com>

	split: avoid apparent infloop when splitting /dev/zero w/-n on the Hurd
	* src/split.c (main): Use stat.st_size only for regular files.
	Samuel Thibault reported in http://bugs.gnu.org/11424 that the
	/dev/zero-splitting tests would appear to infloop on GNU/Hurd,
	because /dev/zero's st_size is LONG_MAX.  It was only a problem
	when using the --number (-n) option.
	* NEWS (Bug fixes): Mention it.
	This bug was introduced with the --number option, via
	commit v8.7-25-gbe10739

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

2012-05-08  Pádraig Brady  <P@draigBrady.com>

	doc: clarify dd conv=sparse usage with devices
	* doc/coreutils.texi (dd invocation): Clarify that NUL blocks
	are not copied for devices either, and give examples of where
	it might be useful.

2012-05-08  Jim Meyering  <meyering@redhat.com>

	maint: new function: usable_st_size

2012-05-08  Kevin Lyda  <kevin@ie.suberic.net>

	maint: fix common spelling errors
	These were identified using: https://github.com/lyda/misspell-check
	executed like: git ls-files | misspellings -f -

	* src/cat.c: Correct a spelling error.
	* src/comm.c: Likewise.
	* src/expr.c: Likewise.
	* src/pr.c: Likewise.
	* src/tac.c: Likewise.
	* src/test.c: Likewise.
	* src/ChangeLog-2005: Likewise.
	* src/ChangeLog-2007: Likewise.
	* src/NEWS: Likewise.
	* src/doc/coreutils.texi: Likewise.
	* src/lib/ChangeLog-2007: Likewise.
	* src/man/help2man: Likewise.
	* src/old/fileutils/ChangeLog-1997: Likewise.
	* src/old/fileutils/NEWS: Likewise.
	* src/old/sh-utils/ChangeLog.0: Likewise.
	* src/old/textutils/ChangeLog: Likewise.
	* src/tests/misc/comm: Likewise.
	* src/tests/misc/uniq: Likewise.
	* src/tests/mv/dir2dir: Likewise.
	* src/cfg.mk (old_NEWS_hash): update with `make update-NEWS-hash`

2012-05-07  Jim Meyering  <meyering@redhat.com>

	tests: avoid LD_PRELOAD lookup error for dlsym
	* tests/cp/nfs-removal-race: Link with -ldl.

	cp: handle a race condition more sensibly
	* src/copy.c (copy_reg): In a narrow race (stat sees dest, yet
	open-without-O_CREAT fails with ENOENT), retry the open with O_CREAT.
	* tests/cp/nfs-removal-race: New file.
	* tests/Makefile.am (TESTS): Add it.
	* NEWS (Bug fixes): Mention it.
	Reported by Philipp Thomas and Neil F. Brown in
	http://bugs.gnu.org/11100

	doc: NEWS: note when the id/groups bug was introduced
	* NEWS (Bug fixes): Note the first affected release.
	The id bug was introduced by commit v8.0-112-g719a95a.

2012-05-04  Jim Meyering  <meyering@redhat.com>

	build: update gnulib submodule to latest

	maint: rely on gnulib's new sys_resource module
	* bootstrap.conf (gnulib_modules): Add sys_resource.
	* src/sort.c: Remove #if HAVE_SYS_RESOURCE_H guard around inclusion
	of <sys/resource.h> and move the inclusion "up" into the alphabetized
	list of its peers.  This also avoids a failure of the
	sc_prohibit_always_true_header_tests syntax-check rule.
	* m4/jm-macros.m4 (gl_CHECK_ALL_HEADERS): Remove sys/resource.h.

2012-05-02  Pádraig Brady  <P@draigBrady.com>

	cp,mv,install: provide POSIX_FADV_SEQUENTIAL hint to input
	This was inadvertently omitted from v8.5-104-g47076e3,
	and gives the same 5% speedup when copying from an SSD.

	* src/copy.c (copy_internal): Apply the FADVISE_SEQUENTIAL hint.

2012-05-02  Jim Meyering  <meyering@redhat.com>

	maint: prohibit an operator at end of line
	Many coding standards, including GNU's, advocate that when
	splitting a line near a binary operator, one should put the
	operator at the beginning of the continued line, rather than
	at the end of the preceding one.  This is for readability:
	such operators are relatively important to readability, and
	they are more apparent at the beginning of a line than
	at the varying-column end of line,
	* cfg.mk (sc_prohibit_operator_at_end_of_line): New rule.
	Exempt test.c and head.c.

	maint: adjust comments to avoid FP match on binary-operator-at-EOL
	* src/ls.c (print_long_format): Reformat comment to avoid "=="
	at end of line.
	Also, "sortkey" is not a word: s/sortkey/sort key/.
	* src/ioblksize.h: Likewise, for "|" from a shell snippet.
	* src/runcon.c: Likewise, for "|" in grammar-like usage.

	maint: with split lines, don't leave an operator at end of line
	* src/copy.c (copy_reg): Split an expression before a binary operator,
	not after it.
	* src/cut.c (set_fields): Likewise.
	* src/id.c (main): Likewise.
	* src/install.c (setdefaultfilecon): Likewise.
	* src/join.c (ignore_case): Likewise.
	* src/pr.c (cols_ready_to_print, init_parameters, print_page): Likewise.
	* src/stty.c (set_window_size): Likewise.
	* src/wc.c (SUPPORT_OLD_MBRTOWC): Likewise.
	* src/who.c (scan_entries): Likewise.
	* src/test.c (binary_operator): Join a split line.
	* src/extent-scan.c (extent_scan_read): Move an ">" from end of line
	to beginning of the following.
	Likewise for two other expressions.

2012-04-30  Pádraig Brady  <P@draigBrady.com>

	cat,cp,mv,install,split: Set the minimum IO block size used to 64KiB
	* NEWS: Mention the change in behavior.
	* src/ioblksize.h: Add updated test results and
	increase value from 32KiB to 64KiB.

2012-04-27  Jim Meyering  <meyering@redhat.com>

	id: -Zn/-Zr: avoid an invalid diagnostic
	* src/id.c (main): Using -Z with -r or -n would fail with "id: cannot
	print only names or real IDs in default format", in spite of that "-Z",
	which specifies a non-default format.  Now, it succeeds and ignores
	the -n or -r option.  The error was that the test for default_format
	was not updated when I added the new --context (-Z) option in
	commit v6.9-33-g5320d0f.

	id: don't call getcon unnecessarily
	* src/id.c (main): Invocations like "id" and "id -G" would call getcon
	to determine the current security context even though that result would
	not be used.  Similarly, when POSIXLY_CORRECT is set.  Rearrange
	conditionals and hoist the POSIXLY_CORRECT test so that we call
	getcon only when necessary.

	maint: id: minor factorization
	* src/id.c (main): Factor out uses of "argc - optind".
	Move option-consistency checks to precede the potential getcon call.

2012-04-27  Jim Meyering  <meyering@redhat.com>

	id,groups: with no user name, print only real and/or effective IDs,
	... i.e., don't use the getpw* functions.

	Before this change, running groups or id with no user name argument
	would include a group name or ID from /etc/passwd.  Thus, under unusual
	circumstances (default group is changed, but has not taken effect for a
	given session), those programs could print a name or ID that is neither
	real nor effective.

	To demonstrate, run this:

	    echo 'for i in 1 2; do id -G; sleep 1.5; done' \
	      |su -s /bin/sh ftp - &
	    sleep 1; perl -pi -e 's/^(ftp:x:\d+):(\d+)/$1:9876/' /etc/passwd
[--snip--]
