31103 Commits

Author SHA1 Message Date
Egmont Koblinger
5de8835672 doc: tty: fix indexing in texinfo
* doc/coreutils.texi: Fix recently introduced typo.
* THANKS.in: Remove as now committed to the repo.
2026-01-21 13:51:58 +00:00
Pádraig Brady
7426643f39 doc: make legacy digest utility --help reference cksum nodes
* src/system.h (oputs_): Map md5sum etc. to cksum urls,
as we only have cksum anchors in the manual to avoid
creating anchors for all of the legacy digest utilities.
2026-01-21 13:51:58 +00:00
Pádraig Brady
1e72a54ca7 doc: tweak tests to avoid false failure with --help
* tests/df/df-output.sh: Use a more relaxed match.
* tests/du/inodes.sh: Likewise.
2026-01-21 13:51:40 +00:00
Pádraig Brady
2dad24adc0 doc: all: use option highlighting and more standard alignment
Adjust all utils to:
  - Have a separate translation per option
  - Use either oputs() or oprintf(), instead of fputs() or printf().
  - Use more standard alignment as discussed in previous commits.
  - Various tweaks to descriptions.
2026-01-21 13:51:40 +00:00
Pádraig Brady
0f5ab6cb8b doc: readlink: improve option ordering in texinfo
* doc/coreutils.texi (readlink invocation): Order -q,-s alphabetically.
2026-01-21 13:51:40 +00:00
Pádraig Brady
1cbfdce425 doc: chcon: use more standard -HLP desciptions
* src/chcon.c (usage): Use emit_symlink_recurse_options ("-P").
2026-01-21 13:51:40 +00:00
Pádraig Brady
e73d594374 doc: highlight -HLP options
* src/system.h (emit_symlink_recurse_options): Highlight -HLP,
for chmod, chcon etc.
2026-01-21 13:51:40 +00:00
Pádraig Brady
e9d398e221 doc: put --help and --version descriptions on separate line
* src/system.h: This aligns the output with the option
description format used in most commands
2026-01-21 13:51:39 +00:00
Pádraig Brady
cab15fc4ef doc: ls: put option description on separate line to option
* src/ls.c (usage): This is less constrained when writing comments,
and more consistent in output alignment.  There is less delineation
between options and descripts, but given options are highlighted
by default now, this is a more appropriate format to use.
Note consistently showing description on the line following the option,
avoids any issue with the user needing to visually line up
the option with a description far to the right.
Note this format more closely aligns with that used in man pages.
2026-01-21 13:51:39 +00:00
Pádraig Brady
3950891eaa doc: viewman: a new helper to quickly view formatted man pages
Use like: man/viewman ls

* man/viewman: Generate man page on the fly, and view.
2026-01-21 13:51:39 +00:00
Pádraig Brady
5939e67704 doc: help2man: account for undisplayed markup in indenting calculations
* man/help2man: This is significant with the indented line
following the dd bs=BYTES "option" at least.
2026-01-21 13:51:39 +00:00
Pádraig Brady
ed91d9a218 doc: help2man: convert all hyperlinks, not just ones in --options
* man/help2man: Make the (--?) part of the match optional.
Note we still extract the dashes, to support the existing
option matching logic in help2man.
2026-01-21 13:51:39 +00:00
Pádraig Brady
f0705a83f6 doc: help2man: support alternate format OSC hyperlinks
* man/help2man: The BEL terminator format was already supported.
Add support for ESC + backslash terminator.  Also split out
and document the regular expression.
2026-01-21 13:51:39 +00:00
Pádraig Brady
e2fdbea10a doc: help2man: convert OSC hyperlinks
* man/help2man: Convert OSC hyperlinks to roff \X escapes,
which will be converted back to OSC hyperlinks when
the man page is displayed on the terminal.
Note formatting is removed from hyperlinked text by default,
thus relying on how the terminal highlights hyperlinks,
but --bold-refs is honored in this case, in which hyperlinked
text will be marked up as bold, which matches the default
markup used for non hyperlinked options.
2026-01-21 13:51:39 +00:00
Pádraig Brady
d06a666429 doc: help2man: recognise option description with smaller indent
* man/help2man: Allow for a smaller indented option description.
This smaller indentation is present in timeout --help output,
so now the line spacing in timeout.1 is more consistent.
Also having the description on a separate line with
a smaller indentation, is a more general way to present
option descriptions (and what the man page formatting uses already).
We'll be changing many utilities, especially with longer multi-line
descriptions to this new format.
2026-01-21 13:51:39 +00:00
Pádraig Brady
5a21df35b0 doc: help2man: strip ANSI codes
* man/help2man: With these ANSI codes, output is corrupted,
so it's best to strip these, which allows --help to
outputting formatting and hyperlinks by default.
2026-01-21 13:51:39 +00:00
Pádraig Brady
507252c6f2 doc: support highlighting printf formatted options
* src/system.h (oprintf): Add a printf wrapper that
calls oputs_() to markup the formatted text.
2026-01-21 13:51:39 +00:00
Pádraig Brady
d8df94bc02 doc: support more general option matching
* src/system.h: Support "-p DIR, --tmpdir[=DIR]" option.
Previously only the "-p" was highlighted.
Support highlighting dd option syntax (no '-').
Support test(1) "FILE1 -nt FILE2" syntax.
2026-01-21 13:51:39 +00:00
Pádraig Brady
3ec554d4dd doc: parse any whitespace as an option/description delimiter
* src/system.c (oputs_): Use isspace() rather than hardcoding.
Note we don't use c_isspace() as we need to support anything
coming from translations.
2026-01-21 13:51:39 +00:00
Pádraig Brady
cc002057b3 doc: optimize logic to disable SGR output in --help
* src/system.h (oputs_): Simplify processing if neither
MANUAL_URL or BOLD_MAN_REFS is defined.  Also ensure
we only lookup the HELP_NO_MARKUP env var once per process.
2026-01-21 13:51:39 +00:00
Pádraig Brady
4555132f3c doc: move oputs() to system.h to support all commands
* src/ls.c: Move non ls specific helper to ...
* src/system.h: ... here.
2026-01-21 13:51:39 +00:00
Pádraig Brady
5c6cb2b26b doc: support a configurable manual url
* configure.ac: Support ./configure --enable-manual-url=...
* src/ls.c (oputs): Adjust accordingly.
2026-01-21 13:51:39 +00:00
Pádraig Brady
deba7a673d doc: --help: --disable-bold-man-page-references configures bold refs
* configure.ac: Adjust help text for --disable-bold-man-page-references,
and also define BOLD_MAN_REFS.
* src/ls.c (oputs): Output bold iff BOLD_MAN_REFS is defined.
2026-01-21 13:51:39 +00:00
Pádraig Brady
d5e15b2f29 doc: ls: support styling and links in --help output
* src/ls.c (oputs): A new function that wraps puts(),
but also highlights the --option-text portion, and
adds links to the appropriate part of the online manual.
(usage): Call oputs() rather than puts().
* doc/coreutils.texi (--help): Document new HELP_NO_MARKUP env var,
which can be used in the edge case one wants to suppress ansi escapes.
* tests/misc/getopt_vs_usage.sh: Use HELP_NO_MARKUP to ensure the
test continues to pass.
2026-01-21 13:51:39 +00:00
Pádraig Brady
88760f9c10 tests: test: ensure whitespace ignored when parsing numbers
* tests/test/test.pl: Add a test case.
2026-01-21 13:51:39 +00:00
Pádraig Brady
89ea90fae8 cksum: use more accurate program name in single binary mode
Following commit v9.9-109-gcd5229222

* src/cksum.c (PROGRAM_NAME): In legacy mode, i.e., when built
as a single binary, set the PROGRAM_NAME dynamically based on
the selected digest type.  This is significant in --help
to ensure the correct texinfo node is referenced, and in
--version to ensure the correct utility name is output.
2026-01-21 13:50:37 +00:00
Collin Funk
a96abcbbeb tests: dd: avoid a false test failure on Solaris 11.4
* tests/dd/fail-ftruncate-fstat.sh: Replace the message used by Solaris
11.4 for strerror (EPERM) with the one we expect.
2026-01-19 18:26:45 -08:00
Collin Funk
521a389635 tests: sync: check that all files are processed even when errors occur
* tests/misc/sync.sh: Add the test case.
2026-01-19 11:08:48 -08:00
Collin Funk
aac817f34b tests: sync: also test that -d and -f don't block on a FIFO
* tests/misc/sync.sh: Check 'sync fifo' with no arguments, -d, and -f
separately. Only perform the check for -f if RUN_EXPENSIVE_TESTS=yes
since it may be expensive.
2026-01-19 11:07:28 -08:00
Pádraig Brady
331c5f6857 build: update to latest gnulib
* gnulib: Update to latest.
* NEWS: Mention the bug fix.
https://github.com/coreutils/coreutils/issues/176
2026-01-19 17:57:59 +00:00
oech3
d5164f3d21 tests: env.sh: avoid multi-call binary considerations
A simpler fix than commit v9.9-4-g3b6efd555
which is less dependent on the exact behavior
of a multi-call binary.

* tests/env/env.sh: Use a local script rather than 'true'.
which may be a symlinked multi-call binary.
https://github.com/coreutils/coreutils/pull/174
2026-01-18 21:41:23 +00:00
Collin Funk
740d33b8da doc: post process html with non-GNU make programs
* .gitignore (/build-aux/makeinfo-wrapper.sh):
* Makefile.am (EXTRA_DIST): Remove build-aux/makeinfo-wrapper.sh.
* build-aux/makeinfo-wrapper.sh.in: New file, renamed from
build-aux/makeinfo-wrapper.sh and modified to use @MAKEINFO@ instead of
makeinfo.
* cfg.mk (MAKEINFO): Remove variable.
* configure.ac: Add build-aux/makeinfo-wrapper.sh as a configure file.
* doc/local.mk (MAKEINFO): Define to
$(abs_top_builddir)/build-aux/makeinfo-wrapper.sh.
(AM_MAKEINFOFLAGS): Move over some values from the previous MAKEINFO
definition.
2026-01-18 12:09:47 -08:00
Pádraig Brady
4d03a1e408 tests: strace: consider splice a "read" syscall
* tests/cksum/cksum-c.sh: Add 'splice' to the injection set.
* tests/misc/read-errors.sh: Likewise.
From https://github.com/coreutils/coreutils/pull/167
2026-01-18 16:58:38 +00:00
Pádraig Brady
71ea30a742 maint: prefer NULL to nullptr
NULL is best for C as discussed at:
https://bugs.gnu.org/66221#53

* bootstrap.conf: Remove dependency on nullptr.
* s/nullptr/NULL/.
2026-01-18 15:55:38 +00:00
Pádraig Brady
f7bb91968b doc: add more redirections from legacy *sum to cksum
*  doc/coreutils.texi (md5sum invocation, sha1sum invocation,
b2sum invocation, sha2 utilities): Mention these are legacy interfaces,
and reference 'cksum invocation'.
*  src/cksum.c (usage): Likewise.
*  man/md5sum.x: Redirect to cksum, rather than individual utils.
*  man/sha1sum.x: Likewise.
2026-01-18 14:19:38 +00:00
Pádraig Brady
fcaa3a39c7 tests: use command -v to identify binary
* tests/misc/coreutils.sh: Be more flexibile by using `command -v`
to identify the binary to be executed, rather than linking
directly to the built binary.
2026-01-18 12:48:36 +00:00
Collin Funk
0d5b66ca66 build: fix error building html documentation from tarball
Reported by Egmont Koblinger <egmont@gmail.com> in
<https://lists.gnu.org/r/coreutils/2026-01/msg00111.html>.

* Makefile.am (EXTRA_DIST): Add build-aux/makeinfo-wrapper.sh.
2026-01-17 20:15:25 -08:00
Collin Funk
c1d13a499a tests: avoid a test hang on AIX
* init.cfg (uses_strace_): New function.
(require_strace_): Use it.
tests/cksum/cksum-c.sh: Likewise.
tests/misc/read-errors.sh: Likewise.
2026-01-17 14:26:26 -08:00
Collin Funk
44746418db build: update gnulib submodule to latest 2026-01-17 14:12:27 -08:00
Pádraig Brady
6328e7f17d maint: remove sc_prohibit_NULL syntax check
* cfg.mk: NULL is fine and good in C as per:
https://bugs.gnu.org/66221#53
2026-01-17 12:45:42 +00:00
Pádraig Brady
8d791ada1e build: update gnulib submodule to latest 2026-01-17 12:45:08 +00:00
Collin Funk
289278eee2 maint: pacify another gcc -Wzero-as-null-pointer-constant warning
* src/uptime.c (print_uptime): Add a timezone_t cast to zero. Don't use
nullptr since timezone_t is not a standardized and may be defined to
something other than a pointer.
2026-01-16 22:56:15 -08:00
Paul Eggert
23e696b0b2 maint: spelling fixes 2026-01-16 13:22:28 -08:00
Paul Eggert
676c3bb397 build: update gnulib submodule to latest 2026-01-16 13:06:45 -08:00
Paul Eggert
1202fac2dc maint: pacify gcc -Wzero-as-null-pointer-constant
* src/basenc.c (long_options):
* src/chcon.c (change_file_context):
* src/copy.c (is_ancestor):
* src/env.c (build_argv):
* src/expr.c (nomoreargs):
* src/factor.c (mp_no_factors):
* src/ls.c (long_options, main):
* src/selinux.c (defaultcon, restorecon_private):
* src/shred.c (dopass):
* src/shuf.c (long_opts):
* src/tac.c (output):
* src/test.c (term):
* src/uniq.c (check_file): Do not use ‘0’ as a null pointer
constant.  Although it is typically valid C, there are exceptions
(e.g., stdarg) and it a bit cleaner to be consistent.  This patch
uses NULL, not nullptr, as I have second thoughts about nullptr;
see <https://bugs.gnu.org/66221#53>.
2026-01-15 22:36:16 -08:00
Collin Funk
2d45a671a0 build: fix link errors with multi-call binary and 'cksum' excluded
* src/local.mk (src_ls_LDADD, src_seq_LDADD, src_md5sum_LDADD)
(src_sha1sum_LDADD, src_sha224sum_LDADD, src_sha256sum_LDADD)
(src_sha384sum_LDADD, src_sha512sum_LDADD): Set to
$(src_cksum_LDADD).
Reported at https://github.com/coreutils/coreutils/issues/172
2026-01-15 18:21:01 -08:00
Pádraig Brady
6b32a0bbde all: with multi-call binary, only process options for known names
Setup
  $ ln -nsf src/coreutils foo

Before
  $ ./foo; echo $?
  foo: unknown program ‘foo’
  Try './foo --help' for more information.
  1
  ./foo --version; echo $?
  coreutils (GNU coreutils) 9.9.172-01993
  0

After
  $ ./foo; echo $?
  coreutils: unknown program 'foo'
  1
  $ ./foo --version; echo $?
  coreutils: unknown program 'foo'
  1

* src/coreutils.c (main): Don't process options if
we don't know they're intended for the multi-call binary.
Otherwise `foo --version` would return true, even though
foo was symlinked to the multi-call binary, but not supported.
* tests/misc/coreutils.sh: Add test cases.
* NEWS: Mention the change in behavior.
2026-01-15 15:54:29 +00:00
Pádraig Brady
36d6cb2774 doc: paste: give a CSV generation example
* doc/coreutils.texi (paste invocation): Provide an example
to comma separate data.
2026-01-15 15:54:18 +00:00
Pádraig Brady
a0119d5982 build: paste: fix build failure with C99
GCC 10.2 gave the following error:
"error: a label can only be part of a statement
 and a declaration is not a statement"

* src/fold.c (fold_file): Add a ";" to avoid C2X specific syntax.
2026-01-14 11:38:59 +00:00
Collin Funk
418d4084b4 maint: avoid syntax-check failure from previous commit
* src/copy-file-data.c (sparse_copy): Use nullptr instead of NULL.
2026-01-13 20:45:32 -08:00