Note mktemp --suffix has the same inconsistency,
but mktemp -d does support creating dirs
so probably best to leave that as is.
* src/split.c (main): Check for trailing /.
* tests/split/additional-suffix.sh: Augment the test.
Reported in https://bugs.debian.org/1036827
* src/dd.c: Don't include no longer used error.h.
Use quoteaf() rather than quote() to quote appropriate for the shell
and to avoid the syntax-check failure,
* src/stty.c: Use quoteaf() rather than quotef()
to have more consistent quoting of the invalid arg.
src/cfg.mk (sc_error_quotes, sc_error_shell_quotes,
sc_error_shell_always_quotes): Include "die" and "diagnose"
in the class of error functions to check arguments for.
* src/dd.c (_GL_NO_INLINE_ERROR): Remove; no longer needed.
(diagnose): Rename from nl_error and omit first arg since it is
always zero. All uses changed.
(error): Remove macro.
Following on from commit v9.0-15-gaa31b919c
which updated README-prereq...
* bootstrap.conf: Add an explicit requirement on m4.
Add an explicit requirement on texi2pdf which is often
packaged separately to makeinfo and induces a failure
far down the distribution phase if not present.
Replace the rsync dependency with wget,
which gnulib changed to in 2018.
This reverts commit 800c86d5, as that was deemed too invasive.
We do keep the change to tee.c to allow using -O3 without warnings.
For other optimization options like -O0, -Og, -O1, -Os,
one can use WERROR_CFLAGS= to stop warnings inducing a build failure.
Allow easily building a debug build for example with:
make CFLAGS='-O0 -ggdb'
False -Wmaybe-uninitialized warnings hit in different
places depending on the compiler passes used.
These changes were tested with gcc 10.2.1, 12.2.1, and 13.1.1 like:
for o in g s z fast 0 1 2 3; do
make clean && make -j$(nproc) CFLAGS="-O$o" || break
done
* src/digest.c: Disable -Wmaybe-uninitialized that gives
false positive here at -O0.
* src/ln.c: Avoid -Wmaybe-uninitialized that gives
false positive here at -O1.
* src/pr.c: Likewise.
* src/sort.c: Likewise.
* src/tee.c: Avoid -Wmaybe-uninitialized that gives
false positive here at -O3 on gcc 13.1.1 at least.
* src/cp.c: Avoid -Wmaybe-uninitialized that gives
false positive here at -Os on gcc 13.1.1 at least.
* src/copy.c: Avoid -Wmaybe-uninitialized that gives
false positive here at -Og on gcc 13.1.1 at least.
* src/head.c: Likewise.
* src/paste.c: Likewise.
Tested on gcc 13.1.1 with: make CFLAGS='-O0 -ggdb'
* configure.ac: Disable -Wstringop-overflow for gnulib.
This warning is far too problematic in my experience:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88443
and triggers with gcc -O0 with versions 12,13 at least.
As split is often dealing with large files,
ensure we indicate to the kernel our sequential access pattern.
This was seen to operate 5% faster when reading from SSD,
as tested with:
dd bs=1M count=2K if=/dev/urandom of=big.in
for split in split.orig split; do
# Ensure big file is not cached
dd of=big.in oflag=nocache conv=notrunc,fdatasync count=0 status=none
# Test read efficiency
CWD=$PWD; (cd /dev/shm && time $CWD/src/$split -n2 $CWD/big.in)
done
real 0m9.039s
user 0m0.055s
sys 0m3.510s
real 0m8.568s
user 0m0.056s
sys 0m3.752s
* src/split.c (main): Use fdadvise to help the kernel
choose a more appropriate readahead buffer.
* NEWS: Mention the improvement.
This fixes failures in "very-expensive" tests on FTS with many
directory entries:
FAIL: tests/rm/ext3-perf
FAIL: tests/rm/many-dir-entries-vs-OOM
The following shows the problem in the former of the above tests:
$ mkdir d && seq 400000 | env -C d xargs touch )
$ rm -rf d
rm: traversal failed: d: Operation not supported
Gnulib commit 3f0950f65abb (2023-04-26) introduced this regression
which was fixed again with gnulib commit d4d8abb39eb0.
See discussion in
<https://lists.gnu.org/r/bug-gnulib/2023-05/msg00040.html>
* bootstrap.conf (gnulib_modules): Change "year2038-required" to
"year2038-recommended"; the module has been replaced.
* gnulib: Update to latest.
* tests/init.sh: Likewise.
Before:
$ pr --expand-tabs=
pr: '-e' extra characters or invalid number in the argument:
‘SHELL=/bin/bash’: Value too large for defined data type
After:
$ pr --expand-tabs=
pr: '-e': Invalid argument: ‘’
* src/pr.c (getoptarg): Ensure we don't parse beyond the
end of an empty argument, thus outputting arbitrary stack
info in subsequent error messages.
Addresses https://bugs.debian.org/1035596
This doesn’t change behavior; it just clarifies the code a bit.
* src/cp.c (re_protect): New arg DST_SRC_NAME, for clarity, and so
that we need to skip '/'s only once. Caller changed.
Rename a couple of local variables to try to make things clearer.
* src/cp.c (re_protect): Ensure copy_acl() is passed an absolute path.
* tests/cp/cp-parents.sh: Add a test case.
* NEWS: Mention the bug.
Fixes https://bugs.gnu.org/63245
* README: State that DEBUG=yes is particularly useful with perl tests.
* tests/split/l-chunk.sh: Use the more standard $DEBUG variable
rather than an internal $DEBUGGING variable.
* configure.ac (WERROR_CFLAGS): Omit mention of
-Wno-analyzer-double-free, -Wno-analyzer-null-dereference, and
-Wno-analyzer-use-after-free as manywarnings no longer uses them.
* src/csplit.c, src/fmt.c, src/make-prime-list.c, src/nohup.c:
Add pragmas to pacify GCC 13 when coreutils is configured
with --enable-gcc-warnings='expensive'.
* src/chmod.c (main): Use xpalloc instead of X2REALLOC,
and make the corresponding variables signed instead of unsigned.
When reallocating the buffer, this grows it by a factor of 1.5, not 2.
This also pacifies gcc -Wanalyzer-null-dereference.
* src/csplit.c (load_buffer): Refactor for clarity.
This also xpacifies gcc -Wanalyzer-use-of-uninitialized-value.
When reallocating the buffer, grow it by a factor of 1.5, not 2.
* tests/misc/read-errors.sh: Exercise more modes of
various utilities for better read error coverage.
* tests/split/fail.sh: Remove part refactored into the above test.
Avoid the following error with -mno-ssse3:
inlining failed in call to 'always_inline' '_mm_shuffle_epi8':
target specific option mismatch
* configure.ac: Ensure we use ssse3 specific code when
checking whether to enable the pclmul cksum implementation.
* src/pr.c (init_parameters): Ensure we avoid a 0 lines_per_body
which was possible when adjusting for double spacing.
That caused print_page() to always return true,
causing an infinite loop.
* tests/pr/pr-tests.pl: Add a test case.
* NEWS: Mention the fix.
Fixes https://bugs.debian.org/1034808
Since skipping of files is central to the operation of -i and -u,
and with -u one may be updating few files out of many,
reinstate the verbosity of this functionality as it was before 9.3.
* src/copy.c (copy_internal): Only output "skipped" message
with --debug. Also adjust so message never changes with --debug.
* tests/cp/cp-i.sh: Adjust accordingly.
* tests/mv/mv-n.sh: Likewise.
* tests/cp/debug.sh: Add explicit test case for message.
* NEWS: Mention the change in behavior.
When run under QEmu emulation emulated /proc files have
unstable inode numbers.
* tests/cp/proc-short-read.sh: Skip if unstable inode numbers detected.
* src/install.c (strip): Prepend "./" to file names with a leading "-".
* tests/install/strip-program.sh: Add a test case.
* NEWS: Mention the bug fix.
Reported in https://bugs.debian.org/1034429
* tests/misc/tty-eof.pl: Ensure we don't erroneously
skip commands with parameters.
Comment as to why cut(1) is treated differently.
Adjust expect calls to not wait needlessly for cut output.
* tests/cp/sparse-2.sh: Don't depend on the copy taking
<= allocation of the source. Instead leverage --debug
to check that zero detection is being enabled.
Fix a build failure seen on gcc 3.4 on Solaris 10 at least.
* src/crctab.c: Ensure we include config.h for all compilation units.
This is now required for new _Noreturn usage in gnulib for stdint.h.
* src/cksum.c: Update generation code to ensure config.h included.
* cfg.mk: Remove crctab.c exclusion from the config.h check.