aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2025-06-22build: add src/termios.c to the tarballCollin Funk1-1/+2
* src/local.mk (EXTRA_DIST): Add src/termios.c.
2025-06-22maint: use _GL_CMP instead of handwriting three-valued comparisonsCollin Funk6-13/+11
* src/comm.c (compare_files): Use _GL_CMP. * src/join.c (keycmp): Likewise. * src/ls.c (off_cmp): Likewise. * src/ptx.c (compare_words, compare_occurs): Likewise. * src/set-fields.c (compare_ranges): Likewise. * src/sort.c (compare_random, diff_reversed, compare): Likewise.
2025-06-21doc: NEWS: improve recent stty detailsH. Peter Anvin1-1/+1
* src/NEWS: Fix grammar error, and indicate baud rate probing is opportunistic.
2025-06-21tty: translate new errorPádraig Brady1-1/+1
* src/tty.c (main): Translate and adjust new ttyname() error diagnostic, to be clearer and avoid a syntax check failure.
2025-06-20tty: better fix for Bug#26371Paul Eggert5-10/+27
* src/tty.c (TTY_USAGE): Rename from TTY_FAILURE, since this is used only for usage failures. All uses changed. (TTY_TTYNAME_FAILURE): New constant. (main): Remove no-longer-needed assignment of ENOENT to errno. Make status-setting clearer too. Report an error if ttyname fails even though stdin is a terminal, instead of silently pretending that stdin is not a terminal. * tests/tty/tty.sh: Test for this issue. This should fix Bug#78244.
2025-06-18tests: stty: adjust tests for arbitary speedsPádraig Brady4-2/+69
* tests/stty/stty-invalid.sh: Adjust to what is now invalid. * tests/stty/stty.sh: Add checks for valid speed variants. * tests/stty/bad-speed.sh: New test to ensure unsupported speeds are diagnosed.
2025-06-18stty: arbitrary or non-a priori known speed_t supportH. Peter Anvin6-89/+198
Support the case where speed_t is simply a number, and in that case assume that arbitrary values can be passed. This is assumed to be the case when all known speed_t macros equal their own value. Try to probe for a variety of speed_t constants by trying to coax $(CC) into emitting macro definitions (-E -dM). If this is not supported, use a fairly extensive list of constants as a fallback. This both improves the test for arbitrary speed support, as well as allowing proper operation in the case where the constants are not plain numbers and allows for handing enumerated speed constants that were not known a priori when the source code was written. A simple shell script (mostly using sed) is used to turn the list of constants (probed and predefined) into a pair of conversion functions, baud_to_value() and value_to_baud(); string_to_baud() is then reimplemented as a wrapper around the latter. * src/.gitignore: Add generated speedlist.h. * src/local.mk: Generate speedlist.h. * src/speedgen: Portable shell script to generate speedlist.h. * src/stty.c: Adjust string_to_baud to convert from arbitrary numeric values. * src/termios.c: A helper used when generating speedlist.h * NEWS: Mention the improvement.
2025-06-10date: port test to NetBSD 10Paul Eggert1-3/+6
Problem reported by Collin Funk in: https://lists.gnu.org/r/bug-gnulib/2025-06/msg00094.html * tests/date/date-debug.sh: Also allow NetBSD 10 mktime behavior. Although NetBSD contradicts POSIX, POSIX is likely wrong here and I vaguely recall that there’s a POSIX correction in progress that will allow the NetBSD behavior.
2025-06-08build: update gnulib submodule to latestPaul Eggert2-1/+1
* tests/date/date-debug.sh: Update to match current behavior of Gnulib's parse-datetime module.
2025-06-07doc: cp --help: mention --reflink=auto is now the defaultPádraig Brady1-4/+4
* src/cp.c (usage): Reword the REFLINK description to indicate that --reflink=auto is the default. Fixes https://github.com/coreutils/coreutils/issues/103
2025-06-03doc: make command synopsis more consistentPádraig Brady4-14/+10
* doc/coreutils.texi: Use @dots{} after [OPTION], to be consistent with man pages. * src/printenv.c (Usage): Remove unneeded "...". * src/timeout.c (Usage): Add needed "...", and also remove redundant [OPTION] only form. * src/chroot.c (Usage): Likewise. Fixes https://bugs.gnu.org/78628
2025-05-29cksum: port to Apple LLVM version 10.0.0Paul Eggert2-2/+7
This compiler lacks support for the x86-64 VPCLMULQDQ instruction; compiles fail with "error: invalid cpu feature string for builtin". Problem reported by Peter Dyballa, and fix suggested by Pádraig Brady <https://bugs.gnu.org/78562#8>. * configure.ac (USE_AVX512_CRC32): Also check that __builtin_cpu_supports ("vpclmulqdq") compiles.
2025-05-28tests: sort: expand multiple output testingPádraig Brady1-0/+5
* tests/sort/sort.pl: Ensure duplicate output strings are supported.
2025-05-28maint: assume O_DIRECTORYPaul Eggert3-65/+10
Recent changes in Gnulib guarantee O_DIRECTORY != 0. * gl/lib/targetdir.c (target_directory_operand): * src/dd.c (usage): * src/ln.c (main): Simplify now that O_DIRECTORY must be nonzero.
2025-05-28build: update gnulib submodule to latestPaul Eggert1-0/+0
2025-05-24maint: avoid a sc_system_h_headers failurePádraig Brady1-1/+3
* cfg.mk: Also exclude libstdbuf.c from this check.
2025-05-24stdbuf: don’t allocate more than SIZE_MAX / 2Paul Eggert1-2/+5
* src/libstdbuf.c (apply_mode): Be more conservative about sizes passed to malloc, since we can’t rely on Gnulib malloc.
2025-05-24stdbuf: simplify apply_mode + getenvPaul Eggert1-12/+12
* src/libstdbuf.c (apply_mode): Take getenv arg, not result. All callers changed. This is simpler.
2025-05-24stdbuf: port better to Mac OS X 10.4.11Paul Eggert1-37/+18
Do not link to fchownat, fchmodat, xreallocarray. While we’re at it, depend as little as possible on problematic functions like fileno, strtoumax. Use only functions that were around in C89. Problem reported by Peter Dyballa <https://bugs.gnu.org/78509#59>. * src/libstdbuf.c: Include stddef.h, stdlib.h, gettext.h. Do not include stdint.h or system.h. (_): New macro, since we no longer include system.h. Undef strtoul, not strtoumax. (fileno_to_name): Remove. All uses removed. (apply_mode): New arg STREAM_NAME, so that we no longer need to depend on fileno which might run into a Gnulib workaround. Don’t allocate more than ULONG_MAX - 1 bytes, as that’s not helpful in the real world and this lessens dependency on newer features like strtoumax.
2025-05-21tests: avoid hung tests on older macOSPádraig Brady2-2/+2
These tests were seen to hang on PPC Mac OS X 10.4.11 * tests/cp/existing-perm-race.sh: Protect fifo interactions with a 1 minute timeout. * tests/cp/file-perm-race.sh: Likewise. Reported in https://bugs.gnu.org/78509
2025-05-20sort: fix buffer under-read (CWE-127)Pádraig Brady4-2/+51
* src/sort.c (begfield): Check pointer adjustment to avoid Out-of-range pointer offset (CWE-823). (limfield): Likewise. * tests/sort/sort-field-limit.sh: Add a new test, which triggers with ASAN or Valgrind. * tests/local.mk: Reference the new test. * NEWS: Mention bug fix introduced in v7.2 (2009). Fixes https://bugs.gnu.org/78507
2025-05-18maint: omit -Wmissing-variable-declarations from testsPaul Eggert1-0/+1
* configure.ac (GNULIB_WARN_CFLAGS): Omit -Wmissing-variable-declarations; needed for gcc (GCC) 15.1.1 20250425 (Red Hat 15.1.1-1).
2025-05-18maint: avoid sc_preprocessor_indentation failurePádraig Brady1-1/+1
* src/factor.c: Tweak preprocessor indentation.
2025-05-18build: generate src/crctab.c when building from gitCollin Funk4-444/+24
* src/crctab.c: Remove file. * src/cksum.c [!CRCTAB]: Include config.h. * src/local.mk: Generate src/crctab.c in a temporary directory. (EXTRA_DIST): Add src/crctab.c. * .gitignore (/src/crctab.c): Add entry.
2025-05-18build: fix 'make distcheck'Collin Funk1-0/+1
* src/local.mk (EXTRA_DIST): Distribute src/make-prime-list.c to satisfy the new make dependency.
2025-05-17factor: fix bug with 128-bit uintmax_tPaul Eggert2-3/+31
On so-far-only-theoretical platforms with 128-bit uintmax_t, 'factor' would misbehave by not factoring enough. Work around the bug (at a performance cost) and document the issue. I hope someone with more time and expertise can fix the performance cost that this introduces. To reproduce the correctness bug, build with 'gcc -DUSE_INT128 -DEXHIBIT_INT128_BUG'; 'make check' should fail due to the new test case. * src/factor.c (USE_INT128): New macro. (wide_uint, wide_int, W_TYPE_SIZE, WIDE_UINT_MAX): Define to proper values if USE_INT128. (prime_p) [!EXHIBIT_INT128_BUG]: Work around bug with 128-bit wide_uint, at some performance cost. * tests/factor/factor.pl (bug-with-128-bit-uintmax_t): New test.
2025-05-17factor: refactor to allow non-uintmax_t intsPaul Eggert2-165/+169
This prepares for using unsigned __int128 instead of uintmax_t. It doesn’t change behavior. * src/factor.c (wide_uint, wide_int): New typedefs, replacing all uses of uintmax_t, intmax_t. (WIDE_UINT_MAX): New macro, replacing all uses of UINTMAX_MAX. (USE_LONGLONG_H): Don’t use LONG_MAX and INTMAX_MAX (which should have been ULONG_MAX and UINTMAX_MAX anyway). Instead, use W_TYPE_SIZE and ULONG_WIDTH, as that will be easier to work with if we use unsigned __int128. (binv): Also unroll for the 128-bit case. * src/make-prime-list.c (print_wide_uint): Print "wide_uint" not "uintmax_t".
2025-05-17build: support cross-compiling directly from git checkoutCollin Funk4-27/+37
* src/local.mk: Compile the make-prime-list in a temporary directory using $(BUILD_CC) so it can be run even when $(CC) is a cross-compiler. Add some comments. (noinst_PROGRAMS): Remove src/make-prime-list. (src_make_prime_list_LDADD): Remove variable. * src/make-prime-list.c: Don't include config.h and attributes.h. Remove unnecessary #undefs (ATTRIBUTE_CONST, ATTRIBUTE_MALLOC): Define for the host compiler. Fixes https://bugs.gnu.org/78377
2025-05-15maint: --help now outputs bug reporting addressPaul Eggert2-11/+2
This changes the tail of "cat --help" output from: GNU coreutils online help: <https://www.gnu.org/software/coreutils/> Full documentation <https://www.gnu.org/software/coreutils/cat> or available locally via: info '(coreutils) cat invocation' to: Report bugs to: bug-coreutils@gnu.org GNU coreutils home page: <https://www.gnu.org/software/coreutils/> General help using GNU software: <https://www.gnu.org/gethelp/> Full documentation <https://www.gnu.org/software/coreutils/cat> or available locally via: info '(coreutils) cat invocation' * src/system.h (emit_bug_reporting_address): Don’t #define. (emit_ancillary_info): Call emit_bug_reporting_address instead of doing it by hand, which omitted the bug reporting address.
2025-05-12maint: avoid sc_gitignore_missing failurePádraig Brady2-1/+3
* .gitignore: Add the soon to be generated lib/fts_.h * cfg.mk (sc_gitignore_missing): Special case the mapping of fts.in.h to fts_.h. Fixes https://bugs.gnu.org/78398
2025-05-12doc: NEWS: fix introduced version of a bugPádraig Brady1-1/+1
* NEWS: The NFSv4 trivial ACL ENOTSUP issue was introduced in 9.6.
2025-05-12maint: avoid sc_GPL_version failurePádraig Brady1-1/+1
* cfg.mk (VC_LIST_ALWAYS_EXCLUDE_REGEX): Exclude longlong.h also.
2025-05-12doc: suggest GNULIB_REFDIR instead of GNULIB_SRCDIRCollin Funk1-1/+1
* README-hacking: Use GNULIB_REFDIR instead of GNULIB_SRCDIR since that is the correct way to have ./bootstrap do 'git clone --reference'.
2025-05-12factor: check overflow with ckd_add etcPaul Eggert1-21/+9
* src/factor.c (umul_ppmm, add_ssaaaa, sub_ddmmss, submod) (mulredc, strto2wide_uint): Prefer ckd_add etc. to doing overflow checking by hand.
2025-05-12maint: pacify GCC when selinux is missingPaul Eggert1-4/+4
* src/selinux.h (restorecon, defaultcon): Use MAYBE_UNUSED.
2025-05-12factor: be more cautious about C compiler versionsPaul Eggert1-3/+10
* src/factor.c (__GMP_GNUC_PREREQ): Define compatibly with GMP.
2025-05-12maint: sync longlong.h from gmpPaul Eggert2-12/+27
* .x-update-copyright: Add src/longlong.h. * src/longlong.h: Sync from gmp.
2025-05-12factor: omit incorrect affirms in mulredc2Paul Eggert1-2/+0
* src/factor.c (mulredc2): Remove two ‘affirm’ calls that didn’t match the accompanying comment, and one of which has a false positive if UINTMAX_WIDTH == 128 and we factor 2**128 + 1.
2025-05-11build: update gnulib submodule to latestCollin Funk2-20/+38
* bootstrap: Update using './bootstrap --bootstrap-sync'.
2025-05-09maint: update NEWS from Gnulib updatePaul Eggert1-0/+6
2025-05-09build: update gnulib submodule to latestPaul Eggert1-0/+0
2025-05-09maint: minor followon touchup of GCC warningsPaul Eggert1-1/+3
* configure.ac (GNULIB_TEST_WARN_CFLAGS): Do not use -Wsuggest-attribute=cold, -Wsuggest-attribute=const, -Wsuggest-attribute=format as they produce false positives with GCC 15 x86-64. Use -Wmissing-variable-declarations, as it no longer seems to hurt.
2025-05-09maint: modernize GCC warning configurationPaul Eggert1-45/+3
* configure.ac: Simplify the setup of GCC’s -W... options, by removing options no longer needed for GCC 15 (when configuring with --enable-gcc-warnings) or GCC 12 (without). I hope this is good enough nowadays. Add GCC 15’s -Wtrailing-whitespace, since that works for us.
2025-05-09maint: use MAYBE_UNUSED more consistentlyPaul Eggert7-22/+27
* src/basenc.c (no_required_padding): * gl/lib/smack.h (smack_new_label_from_self) (smack_set_label_for_self): * src/cksum.c (output_crc): * src/digest.c (md5_sum_stream, sha1_sum_stream) (sha224_sum_stream, sha256_sum_stream, sha384_sum_stream) (sha512_sum_stream, sm3_sum_stream, output_file): * src/stat.c (print_statfs, print_stat): * src/sum.c (output_bsd, output_sysv): * src/timeout.c (chld): Mark possibly-unused parameters with MAYBE_UNUSED.
2025-05-09maint: fix Automake warningPaul Eggert1-4/+1
* Makefile.am (prologue): Remove macro, as \# is not portable here and Automake complains. Replace its only use with its definiens.
2025-05-03tests: avoid false failures in user namespacesPádraig Brady1-1/+5
* init.cfg (require_membership_in_two_groups_): Skip overflow gids used in user namespaces, as one can't chgrp() to these. Fixes https://bugs.gnu.org/78225
2025-05-01build: update to latest gnulibPádraig Brady4-3/+3
* bootstrap.conf: Adjust for hash-triple module renaming. * src/copy.c: Likewise. * src/ln.c: Likewise. * gnulib: Update to latest.
2025-04-23tests: add a test case for negative relative datePádraig Brady1-0/+3
* tests/date/date.pl: To exercise option processing.
2025-04-21tests: fix false failure with constrained setfaclPádraig Brady1-1/+1
* tests/ls/acl.sh: In constrained environments, like with setxattr() disabled for example, require_acl_ does not check for the required functionality, so use the more stringent require_setfacl_ instead. Reported at https://github.com/NixOS/nixpkgs/issues/394953
2025-04-19maint: map Jim's new email addressPádraig Brady1-0/+1
.mailmap: Add meta.com as an alias.