1486 Commits

Author SHA1 Message Date
Jim Meyering
bbc1bdb771 maint: update copyright dates 2026-01-02 16:52:26 -08:00
Jim Meyering
301eca636b build: update gnulib to latest, and update bootstrap 2026-01-02 16:51:54 -08:00
Paul Eggert
33ce4260b8 diff: tweak -q, -s doc
Problem reported by Dan Jacobsen (bug#79959).
* src/diff.c (option_help_msgid): Tweak.
2025-12-07 09:41:44 -08:00
Paul Eggert
6ad4a619d4 diff: tweak signal initialization
* src/syncsig.c (syncsig_install): No need to initialize
all of signal_count; just the catchable signals.
2025-12-03 09:40:35 -08:00
Paul Eggert
916b50fe96 diff: no need to avoid localcharset
This fixes builds on macOS 12–14.
Problem reported by Bruno Haible (Bug#79887).
* bootstrap.conf (avoided_gnulib_modules): Remove localcharset.
2025-12-03 09:40:35 -08:00
Paul Eggert
a1432a6216 build: update gnulib submodule to latest
* src/context.c (print_contenxt_label):
Adjust to recent Gnulib changes to nstrftime API.
2025-11-02 13:09:16 -08:00
Paul Eggert
a709a0a2bd diff: simplify sigaction configuration
* 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.
2025-11-02 13:09:16 -08:00
Paul Eggert
b4524ba9a6 diff: refactor and improve signal handling
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.
2025-11-02 13:09:16 -08:00
Paul Eggert
6b9c726076 maint: use our textdomain for Gnulib
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.
2025-09-09 10:23:01 -07:00
Paul Eggert
3ccfcd8cd7 build: update gnulib submodule to latest 2025-09-09 10:23:01 -07:00
Paul Eggert
096a3b29b5 maint: remove po/en.po
* po/en.po: Remove.  It wasn’t being used, and we’re now doing its
intent in a less-hassly way.
2025-09-09 10:23:01 -07:00
Paul Eggert
dc6dc9147f cmp: improve LC_MESSAGES test
* 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.
2025-09-09 10:23:01 -07:00
Paul Eggert
cf5648869a maint: use need-formatstring-macros
* 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.
2025-09-09 10:23:01 -07:00
Paul Eggert
e124541148 maint: reduce Gnulib module usage
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.
2025-09-05 14:47:08 -07:00
Paul Eggert
42083759b6 build: update gnulib submodule to latest 2025-09-05 14:47:08 -07:00
Paul Eggert
c08704493d sdiff: simplify give_help slightly
* src/sdiff.c (give_help): Simplify by using fputs instead of fprintf.
2025-09-05 14:47:08 -07:00
Paul Eggert
f3f02235de diff: simplify usage slightly
* src/diff.c (usage): Simplify by omitting a need to call putchar.
2025-09-05 14:47:08 -07:00
Bruno Haible
0cba18b965 build: Update after gnulib changed
* gnulib-tests/Makefile.am: Initialize AM_CFLAGS.
2025-09-05 14:47:08 -07:00
Paul Eggert
2591992037 diff: reduce nstrftime dependency
* configure.ac (REQUIRE_GNUISH_STRFTIME_AM_PM):
Define to 0, since we don’t use AM or PM indicators.
2025-04-27 23:42:49 -07:00
Paul Eggert
c191460adf sdiff: refactor simplification
* src/sdiff.c (skip_white): Simplify a loop.
(edit): Redo nested switches to avoid duplicate code.
2025-04-27 23:42:49 -07:00
Paul Eggert
686357a40c sdiff: port back to C17-
* src/sdiff.c (edit): Do not use a label just before a statement.
Problem reported by Bruno Haible (Bug#78032).
2025-04-27 23:42:49 -07:00
Paul Eggert
49760e9f50 doc: update Autoconf version 2025-04-27 23:42:49 -07:00
Paul Eggert
33ee12e587 build: use system help2man
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.
2025-04-27 23:42:49 -07:00
Paul Eggert
45a4762bf3 sdiff: pacify gcc -flto -Wmaybe-uninitialized
* 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).
2025-04-23 11:46:37 -07:00
Paul Eggert
80053ab7b5 sdiff: continue → break
* src/sdiff.c (edit): Don’t use ‘continue’ when a simple
break from the switch will do.
2025-04-23 11:46:37 -07:00
Jim Meyering
d05765a8f1 maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2025-04-08 19:41:07 -07:00
Jim Meyering
16681a3cbc version 3.12
* NEWS: Record release date.
v3.12
2025-04-08 19:37:19 -07:00
Jim Meyering
6c92d5fb8f tests: cmp: increase timeout to avoid failure on a very busy-IO system
* tests/cmp: Increase timeout from 0.1 to 0.4s, to avoid false-failure
on a system with lots of IO congestion. Reported by Nelson Beebe
in https://lists.gnu.org/r/diffutils-devel/2025-04/msg00007.html
2025-04-08 13:44:18 -07:00
Jim Meyering
7e53977313 build: update gnulib to latest; and update bootstrap 2025-04-04 14:23:49 -07:00
Jim Meyering
53ba74998b maint: ensure that new "make syntax-check"-run sc_codespell passes
* cfg.mk (codespell_ignore_words_list): Ignore false-positive "words".
2025-03-28 08:11:20 -07:00
Jim Meyering
f180b5f4d4 maint: rather than exempt "hight" as a spelling false-positive...
* src/diff3.c (output_diff3): Rename lowt,hight to low_t,high_t.
2025-03-27 21:34:25 -07:00
Paul Eggert
362a759cfb tests: test for diff -y crash
* tests/side-by-side-seq: New test.
* tests/Makefile.am (TESTS): Add it.
2025-02-28 23:14:35 -08:00
Paul Eggert
e9f8e6a439 diff: fix allocation typo leading to crashes
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.
2025-02-28 23:14:35 -08:00
Paul Eggert
58e734dedd tests: make seq replacement more available
This refactoring should let other future tests use ‘seq’.
* tests/diff3 (seq): Move from here ...
* tests/init.cfg: ... to here.
2025-02-28 23:14:35 -08:00
Paul Eggert
706116c651 maint: mention bug#76452 in NEWS 2025-02-21 23:10:06 -07:00
Collin Funk
6395d51a01 diff: add a test case for the recent empty file bug
* tests/empty-file: New file.
* tests/Makefile.am (TESTS): Add the test.
2025-02-21 23:03:38 -07:00
Paul Eggert
6ce0ebd033 diff: don't treat empty files as a different file type
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.
2025-02-21 23:03:38 -07:00
Simon Josefsson
82cbd61848 cmp, diff, diff3, sdiff: support gnulib-l10n
* src/cmp.c (main): Call bindtextdomain for gnulib-l10n.
* src/diff.c (main): Likewise.
* src/diff3.c (main): Likewise.
* src/sdiff.c (main): Likewise.
2025-02-03 15:10:37 -08:00
Jim Meyering
41034e8398 maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2025-02-02 20:52:15 -08:00
Jim Meyering
3f326ae3ea version 3.11
* NEWS: Record release date.
v3.11
2025-02-02 20:43:43 -08:00
Jim Meyering
cdc6555e2c maint: continue writing base64-encoded checksums to announcement
* cfg.mk (announce_gen_args): Set to --cksum-checksums.
2025-02-02 20:43:32 -08:00
Jim Meyering
03e379ecc8 tests: avoid "make check" hang on CentOS Stream 9 with valgrind-3.19.0
* 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.
2025-02-02 19:01:25 -08:00
Jim Meyering
7a32628d4d tests: avoid test failure due to inadequate Solaris 10 tr
* 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
2025-02-02 17:03:47 -08:00
Jim Meyering
ea7c073d2d maint: once again distribute .tar.gz files
* configure.ac: Reenable distribution of gzip-compressed tarballs,
to help reduce the size of the Guix seed, as discussed at
https://lists.gnu.org/r/coreutils/2020-02/msg00042.html and
https://lists.gnu.org/r/sed-devel/2020-01/msg00013.html
* NEWS (Release): Mention this.
Requested by Nicolas Boos
2025-02-02 11:23:56 -08:00
Jim Meyering
cdc6f1490f maint: reflect gnulib module renamings
* 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.
2025-02-01 17:33:34 -08:00
Jim Meyering
142a264d9d build: update gnulib to latest; and update bootstrap 2025-02-01 17:33:34 -08:00
Jim Meyering
dfaa846f09 doc: rewrite the "Unusual File Names" section
* 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>.
2025-01-05 11:43:53 -08:00
Bruno Haible
733e2f6d7f diff: Fix failure of --no-dereference option (regression 2023-07-01)
* 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().
2025-01-05 09:49:41 -08:00
Bruno Haible
088ba9f064 doc: reference continuous integration URLs
* README-hacking (Continuous integration): New section:
list the gitlab and github CI links.
2025-01-05 08:29:10 -08:00
Jim Meyering
d65b41664a maint: update all copyright dates via "make update-copyright" 2025-01-03 09:47:07 -08:00