* configure.ac: Remove checks for sigaction, sigprocmask, sigblock.
The sigprocmask and sigblock checks were not being used anyway.
* src/sdiff.c: Use (defined SA_NOCLDSTOP) instead of HAVE_SIGACTION.
This is what other modules do.
This is so we can improve sdiff signal handling.
* bootstrap.conf: Add stdcountof-h.
* src/Makefile.am (diff_SOURCES): Add syncsig.c.
(noinst_HEADERS): Add syncsig.h.
* src/diff.c, src/util.c: Include syncsig.h.
* src/util.c: Move signal-related stuff from here ...
* src/syncsig.c: ... to here.
(syncsig_install, syncsig_cleanup):
Rename from install_signal_handlers, cleanup_signal_handlers.
All uses changed. Handle some more signals.
Add an option to not handle stop-related signals.
(syncsig_poll, syncsig_deliver):
New functions, which are like the old process_signals
but in two pieces not one. All uses changed.
(syncsig_install): New args FUN and ARG.
Return int on failure. All callers changed.
* src/syncsig.h: New file.
Support diffutils’ traditional way of getting translations,
by telling Gnulib to use diffutils’ message catalog.
* configure.ac (GNULIB_TEXT_DOMAIN): New macro.
* src/cmp.c, src/diff.c, src/diff3.c, src/sdiff.c (main):
Don’t call bindtextdomain ("gnulib", GNULIB_LOCALEDIR)
as the existing bindtextdomain (PACKAGE, LOCALEDIR) call suffices.
* src/cmp.c (hard_locale_LC_MESSAGES): Use setlocale, not gettext,
to decide whether the messages might not be those of the C or
POSIX locale. This is a more reliable way to test whether
the locale is something like en_US.utf8, a locale that does
not have a translation catalog but is not the C locale.
* configure.ac: Pass need-formatstring-macros, not merely
need-ngettext, to AM_GNU_GETTEXT. This is mostly for show, as
diffutils has used format string macros for years and since nobody
uses ancient gettext any more nobody has noticed a problem.
Recentish changes to Gnulib have pulled in more dependencies
on multithreading, locking, and whatnot. Revamp to remove
these unwanted dependencies.
* bootstrap.conf: Also avoid hard-locale, localcharset,
localename-unsafe, localename-unsafe-limited.
Stop avoiding localename.
(avoided_gnulib_tests): New var. Avoid these tests too.
(gnulib-modules): Remove hard-locale, nstrftime.
Add nstrftime-limited.
* configure.ac (gl_cv_func_mbrtowc_C_locale_sans_EILSEQ)
(gl_cv_func_mbrtoc32_C_locale_sans_EILSEQ):
New vars, so that we do not worry about multibyte C locales.
(gl_THREADLIB_DEFAULT_NO): New macro.
Not sure how much it helps, but it can’t hurt.
(SUPPORT_NON_GREG_CALENDARS_IN_STRFTIME): New macro.
* src/cmp.c: Do not include hard-locale.h.
(hard_locale_LC_MESSAGES): Assume that LC_MESSAGES is hard
if and only if "(C)" gets translated. This drags in fewer
dependencies than calling hard_locale.
* src/diff.c: Include strftime.h instead of hard-locale.h.
(hard_locale_LC_TIME): New function, that uses nstrftime
to infer whether the time locale is hard.
(main): Use it instead of hard_locale.
maint: default Gnulib to no multithreading
* configure.ac: Define gl_THREADLIB_DEFAULT_NO
so that Gnulib defaults to no multithreading.
Instead of shipping an old ‘help2man’ that is not properly maintained,
use the system’s ‘help2man’. It was already listed as a build
prerequisite, and being configured via AM_MISSING_PROG.
Problem for FreeBSD and NetBSD reported by Bruno Haible
<https://bugs.gnu.org/72235>.
* man/Makefile.am (EXTRA_DIST): Remove help2man.
($(dist_man1_MANS)): Do not depend on help2man.
Use $(HELP2MAN) instead.
* man/help2man: Remove.
* src/sdiff.c (edit): Portmanteauize two locals into one, which
arguably makes the code clearer, and anyway pacifies gcc -flto
-Wmaybe-uninitialized with gcc (GCC) 15.0.1 20250329 (Red Hat
15.0.1-0) x86-64 (Bug#78019).
But reported by Nick Smallbone, with one-line fix by
Collin Funk <https://bugs.gnu.org/76613>.
* src/io.c (find_and_hash_each_line): Fix size computation.
Reported by Kate Deplaix <kit-ty-kate@outlook.com> in
<https://lists.gnu.org/r/bug-diffutils/2025-02/msg00005.html>.
* src/diff.c (compare_prepped_files): Don't rely on string
file type, as that might not agree with our idea of a file type.
* tests/init.cfg (require_timeout_): New function, from grep.
(require_valgrind_): Use it, to kill -9 after 3 seconds, because the
default SIGINT was insufficient.
* tests/init.cfg (require_utf8_locale_): Solaris 10's /usr/bin/tr
silently malfunctions with multibyte input, so attempt to find a
better one, trying /usr/xpg4/bin/tr and "gtr".
Failing that, skip the test. Reported by Collin Funk in
https://lists.gnu.org/r/diffutils-devel/2025-02/msg00004.html
* bootstrap.conf: Some gnulib modules are now deprecated, in
favor of new names with a "-h" suffix (and stdbool->bool).
Induce this change with the following:
re='inttypes|signal|stdckdint|stdint|sys_types|sys_wait|unistd'
perl -pi -e 's{^('"$re"')$}{$1-h};s{^stdbool$}{bool}' bootstrap.conf
Then, sort the module names.
* doc/diffutils.texi (Unusual File Names): Rewrite to reflect
that file names with e.g., NL and TAB are now quoted.
Reported by Matěj Cepl in <https://bugs.gnu.org/68695>.
* configure.ac: Move system-related tests closer together. Define
O_PATH_SUPPORTS_FSTAT if O_PATH exists and is supported by fstat().
* src/diff.c (O_PATHSEARCH): Don't use O_PATH if it is defined but not
supported by fstat().