* NEWS: Mention the bug fix.
* cfg.mk (exclude_file_name_regexp--sc_prohibit_test_minus_ao): Exclude
NEWS.
* src/test.c (term): Treat '-a' and '-o' as strings instead of expecting
them to be valid unary operators.
* tests/test/test.pl: Add some test cases.
* tests/test/test-diag.pl: Also test the diagnostics with '-a arg'.
$ valgrind --quiet --leak-check=full --show-leak-kinds=definite \
src/ls --hyperlink=always foo bar
ls: cannot access 'foo': No such file or directory
ls: cannot access 'bar': No such file or directory
32 bytes in 1 blocks are definitely lost in loss record 3 of 7
at malloc (vg_replace_malloc.c:447)
by canonicalize_filename_mode_stk (canonicalize.c:450)
by canonicalize_filename_mode (canonicalize.c:471)
by gobble_file.constprop.0 (ls.c:3392)
by main (ls.c:1765)
* src/ls.c (gobble_file): Call free_ent() before returning.
* src/fts-missing.h: Add helper routines to determine
if an FTS entry is skippable. I.e., that is traversed
and not specified on the command line.
* src/chcon.c (process_file): Setup to ignore skippable files.
(change_file_context): Ignore missing files if appropriate.
* src/chmod.c (process_file): Setup to ignore skippable files.
Ignore missing files if appropriate.
(mode_changed): Ignore missing files if appropriate.
* src/chown-core.c (change_file_owner): Setup to ignore skippable files.
Ignore missing files if appropriate.
* src/du.c (process_file): Likewise.
* src/ls.c (print_dir): Ignore missing files if appropriate.
(get_link_name): Likewise.
(gobble_file): Likewise. Also handle the dangling symlink case.
* src/system.h (ignorable_traversal_errno): Match ENOENT for missing
files.
* tests/chcon/traversal-missing.sh: A new test.
* tests/misc/traversal-missing.sh: Likewise.
* tests/local.mk: Reference the new tests.
* NEWS: Mention the bug fix.
Fixes https://bugs.gnu.org/81444
* doc/coreutils.texi (echo invocation): Parameterize the escape list.
(printf invocation): Remove the C escape reference as it mentions
\' which we don't support, and doesn't mention \e which we do support
(and GCC also does). Instead directly present the escape list
as done for the echo command, adjusted accordingly.
Map 'false' to reuse logic from 'true', instead of creating separate
binaries for each utility.
$ size src/coreutils-prev
text data bss dec hex filename
1476092 7348 2191936 3675376 3814f0 src/coreutils-prev
$ size src/coreutils
text data bss dec hex filename
1474612 7348 2191968 3673928 380f48 src/coreutils
* src/local.mk (noinst_HEADERS): Add src/true.h.
(src_false_LDADD): Organize with the rest of the reused programs. Use
$(src_true_LDADD) instead of $(LDADD).
(src_true_SOURCES, src_false_SOURCES): New variables.
* build-aux/gen-single-binary.sh (override_single): Map 'false' to
'true'.
* src/false.c: Remove file.
* po/POTFILES.in: Remove src/false.c.
* cfg.mk (_src): Match src/true-false.c and src/true-true.c.
* src/coreutils-false.c: New file.
* src/true-false.c: Likewise.
* src/true-true.c: Likewise.
* src/true.h: Likewise.
* src/true.c: Include true.h.
(EXIT_STATUS): Always define the macro to use the value of the TRUE_MODE
variable.
(PROGRAM_NAME): Likewise.
* NEWS: Mention the improvement.
Map the '[' command to which selects appropriate behavior at runtime,
rather than separate binaries for each closely related utility.
$ size src/coreutils-prev
text data bss dec hex filename
1485188 7348 2191968 3684504 383898 src/coreutils-prev
$ size src/coreutils
text data bss dec hex filename
1476092 7348 2191936 3675376 3814f0 src/coreutils
* src/local.mk (noinst_HEADERS): Add src/test.h.
(src___SOURCES): Remove src/lbracket.c. Add src/test.c and
src/test-lbracket.c.
(src_test_SOURCES): New variable.
(src/coreutils.h): Adjust the function name to be
single_binary_main_lbracket instead of single_binary_main__.
* build-aux/gen-single-binary.sh: Likewise. Map '[' to 'test'.
(override_single): Adjust the file name to be coreutils-lbracket.c
instead of coreutils-_.c.
* src/lbracket.c: Remove file.
* cfg.mk (_src): Don't match src/lbracket.c in the regular
expression. Match src/test-lbracket.c and src/test-test.c.
* src/coreutils-lbracket.c: New file.
* src/test-lbracket.c: Likewise.
* src/test-test.c: Likewise.
* src/test.h: Likewise.
* src/test.c: Include test.h.
(LBRACKET): Remove macro.
(PROGRAM_NAME): Use the variable TEST_MODE to determine the program
name.
(main): Use the variable TEST_MODE instead of the LBRACKET macro to
implement behavior specific to '['.
* NEWS: Mention the improvement.
* tests/rm/empty-immutable-skip.sh: Use cleanup_() to
remove the immutable attribute, so that false failures
or stale files do not result from e.g. a killed test run.
"install -C" (--compare) has always called chown/chmod on the
destination even after determining that copying was unnecessary,
ever since --compare was added in commit v7.0-182-gdac5f12c6.
need_copy() already verifies that the destination's mode, owner, and
group match (and, with --preserve-context, that the SELinux context
matches too) before skipping the copy, so re-applying them is
redundant, and can needlessly fail on a destination that cannot be
chown/chmod'd even though nothing would actually change, e.g. one
marked immutable with chattr +i.
* src/install.c (install_file_in_file): Skip metadata updates
if we already skipped the data, as previous checks ensure
that the metadata is already as required.
* tests/install/install-C-immutable.sh: Add a test.
(based on tests/rm/empty-immutable-skip.sh).
* tests/local.mk: Reference the new test.
* NEWS: Mention the improvement.
The github mirror is a common interaction point
for issues and pull requests, so reference it in README and HACKING.
Also update the current size of the repo to be more accurate.
Addresses issue #318
* doc/coreutils.texi (install invocation): Mention that
--preserve-timestamps may lose some of the speed advantages of -C,
due to needing to update timestamps for each build.
* tests/dd/nocache.sh: Whether fadvise() is called (uutils)
or avoided (GNU), ensure there is no failure when nocache
is only the ancillary operation being requested.
Link: https://github.com/coreutils/coreutils/pull/276
* tests/cat/splice.sh: Move read/error distinction test to ...
* tests/cat/cat-distinct-err.sh: ... here, and augment.
* tests/local.mk: Reference the new file.
* tests/cut/cut.pl: Add cases verifying that in the C locale -c and
-b -n select a single byte instead of decoding a multi-byte sequence.
Link: https://github.com/coreutils/coreutils/pull/316
* src/pr.c (char_to_clump): Use ckd_add() and report integer overflow.
* tests/pr/options.sh: Add a test case.
* NEWS: Mention the bug fix.
Fixes https://bugs.gnu.org/81393
With an ASAN build we can trigger the issue like:
$ src/factor 22486472939460651857
src/factor.c:888:36: runtime error:
index 675 out of bounds for type 'int_least16_t [675]'
* src/factor.c (factor_using_division): Guard the final unrolled block
before reading a subsequent prime.
* tests/factor/factor.pl: Add a test case.
* NEWS: Mention the bug fix.
Problem caught by Coverity analysis.
* doc/coreutils.texi (touch invocation): Use lower case for @var{}.
This is ambiguous for MM and mm, but these are not ambiguous
from the context, so shouldn't cause confusion.
* doc/coreutils.texi (touch invocation):
Describe -d behavior for HH:MM:60 (Bug#81331), as it seems that a
future version of POSIX will bless GNU touch here.
Be clearer about POSIX vs GNU extensions with -d.
The description of mv --no-clobber got out of sync
between commit v9.1-133-g7a69df889 and v9.4-134-g9907b6f5d
* doc/coreutils.texi (mv invocation): Copy most of the -n
description from the cp --no-clobber description.
* src/mv.c (usage): Likewise. Note this explicitly deprectates
the mv -n option as like cp the exit code varies across platforms.
Solaris 11 was seen to silently fail, while Linux/FreeBSD succeed.
Fixes https://bugs.gnu.org/81377
* NEWS: Mention the bug fix.
* src/du.c (main): Prefer ckd_add to check for overflow. Emit an error
if the value is negative.
* tests/du/max-depth.sh: Add a test case for the bug.
* tests/nproc/nproc-quota.sh: Use command -v nproc instead of
$abs_top_builddir for external usage of tests.
Also quote "$nproc" usage, to support spaces in path.
Link: https://github.com/coreutils/coreutils/pull/310
* tests/mv/mv-special-1.sh: Adjust the python probe to more
closely match how copy.c creates sockets, as otherwise we
get a false failure on systems where mknod() fails with S_IFSOCK,
which was seen on Solaris and FreeBSD at least.
* tests/mv/mv-special-2.sh: Adjust similarly as this
was a latent issue on this root only test.
Reported by Bruno Haible.
* tests/mv/mv-special-1.sh: Moving a socket onto an existing file
on another file system must replace that file, and not for example
unlink the destination first and then fail, leaving the user
with neither file.
Link: https://github.com/coreutils/coreutils/pull/303
A failed shuf invocation should leave an existing output file untouched
rather than truncating it before the failure is detected.
* tests/shuf/shuf.sh: Verify that a missing input file or an unreadable
random source leaves an existing -o file unchanged.
Link: https://github.com/coreutils/coreutils/pull/304
* tests/ls/quoting-utf8.sh: A non-ASCII C1 control character (U+0085
NEL) is not printable, so locale/clocale quoting must octal-escape its
bytes (\302\205) rather than emit them literally. Add a file named
with U+0085 and verify the escaped form for both styles.
gap identified here: https://github.com/uutils/coreutils/pull/13150
Link: https://github.com/coreutils/coreutils/pull/306
A trailing slash only asserts that the operand is a directory. That
is a stat-level check, needing search permission on the parent, not
read permission on the directory itself.
* tests/misc/realpath.sh: Check that a searchable but unreadable
directory still resolves with a trailing slash, with and without -e.
Link: https://github.com/coreutils/coreutils/pull/307
* tests/cp/same-file.sh: A different spelling of the same path
('foo' vs './foo') must still be detected as the same file, so
--remove-destination refuses instead of unlinking the source.
Link: https://github.com/coreutils/coreutils/pull/302
This increases throughput on systems with unlocked stdio functions.
E.g., 2.5x in the following case:
$ timeout 1m taskset 1 shuf -r -i 0-100 \
| taskset 2 uniq -c \
| taskset 3 pv -r > /dev/null
[ 100MiB/s]
$ timeout 1m taskset 1 shuf -r -i 0-100 \
| taskset 2 uniq -c \
| taskset 3 pv -r > /dev/null
[ 246MiB/s]
* src/uniq.c: Include assure.h.
(writeline): Convert the value to a string by hand and use fwrite, which
may be unlocked, instead of printf.
* tests/uniq/uniq-c-width.sh: New test to verify the padding logic.
* tests/local.mk (all_tests): Add the test case.
* NEWS: Mention the improvement.