1460 Commits

Author SHA1 Message Date
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
Jim Meyering
e1bb047793 build: update gnulib to latest 2025-01-03 09:46:44 -08:00
Collin Funk
4eb92b2a80 maint: use Gnulib's stat-time over our own version
* bootstrap.conf (gnulib_modules): Add stat-time.
* configure.ac: Remove check for the st_blksize in struct stat.
* src/system.h: Include stat-time.h.
(STAT_BLOCKSIZE): Remove definition.
* src/analyze.c (diff_2_files):
* src/cmp.c (main):
* src/diff3.c (read_diff):
* src/io.c (sip): Use ST_BLKSIZE instead of STAT_BLOCKSIZE.
2024-10-13 14:19:06 -07:00
Jim Meyering
f81b0a7c1c maint: avoid old-FSF-address syntax-check failure
* man/help2man: Update to help2man-1.48.5, but merging in the
latest #!/usr/bin/env change. Bruno Haible reported that it
failed a new gnulib syntax-check due to an old FSF mailing
address in https://bugs.gnu.org/73139
2024-09-10 15:06:17 -07:00
Bruno Haible
d22d1f67ca build: Fix use of perl on Guix, FreeBSD, NetBSD
* man/help2man: Search for perl in $PATH.
2024-07-22 08:03:47 -07:00
Bruno Haible
7f9bf95640 build: Generate programs' man pages in the source directory, per GCS
* man/Makefile.am ($(dist_man1_MANS)): Generate the *.1 files in
$(srcdir), not in the build dir.
2024-07-22 07:53:56 -07:00
Bruno Haible
5ec3ebf31c build: Fix a build failure in a VPATH build
* src/Makefile.am (cmp.$(OBJEXT) etc.): Depend on version.h.
2024-07-21 10:59:37 -07:00
Paul Eggert
e7387b4ce2 maint: adjust to Gnulib -Wsystem-headers change
* configure.ac (WERROR_CFLAGS): No need to disable
-Wsystem-headers as Gnulib no longer enables it by default.
2024-07-15 14:49:12 -07:00
Paul Eggert
4a6bc03a99 build: update gnulib submodule to latest 2024-07-15 14:49:12 -07:00
Jim Meyering
c31ff07758 build: update gnulib to latest; and update bootstrap 2024-07-04 13:20:23 -07:00
Collin Funk
1d2456f539 maint: import tests/init.sh from Gnulib during bootstrap
* bootstrap.conf (bootstrap_post_import_hook): Use gnulib-tool
--copy-file to import tests/init.sh.
* tests/init.sh: Remove file.
* .gitignore (/tests/init.sh): Add entry.
2024-07-04 13:15:35 -07:00
Collin Funk
8da1f14d84 tests: don't fail when --program-transform-name is used
Problem reported by Jun T <https://bugs.gnu.org/48062>.
* tests/diff3: Use --diff-program=diff since --program-transform-name
is applied after install.
* tests/help-version (sdiff_setup, diff3_setup): Likewise.
2024-06-23 17:47:26 -07:00
Paul Eggert
da0c15f381 diff: avoid memory leak with --color-palette
Problem found indirectly by Coverity, reported by Wasser Mai
(Bug#71535).  Although the Coverity report was wrong, there was a
different potential memory leak nearby.  Fix the problem by
modifying the string in place, avoiding the need to call malloc.
* src/util.c (color_ext_list, struct color_ext_type):
Remove.  Not needed, as the list wasn’t used.
All uses removed.
(get_funky_string): Omit last argument output_count, as it’s
easily calculated by caller.  This lets us call this function
when we don’t care about the count.
(color_palette): Now char *, not char const *, since we
now update through it.
(set_color_palette): Likewise.
(parse_diff_color): Process color palette into itself, to avoid
unnecessary malloc and free calls.  This pacifies Coverity, saves
a bit of space in the normal case, and avoids a memory leak in
some cases.  Do not process the palette twice, as its memory
has been modified and this function had no effect on the
color indicators the second time.
2024-06-19 23:42:53 -04:00
Paul Eggert
54c8930ca5 maint: update .gitignore to add lib/stdbit.h 2024-06-19 23:42:53 -04:00
Paul Eggert
d636f9c117 diff: port to FreeBSD, NetBSD
Problem reported by Bruno Haible <https://bugs.gnu.org/71486>.
* src/diff.c (NOFOLLOW_SYMLINK_ERRNO): New constant.
(compare_files): Use it instead of ELOOP.  When it is not ELOOP,
treat ELOOP as a failure in resolving the parent directory;
this saves a syscall in some situation.
2024-06-11 17:49:03 -07:00
Bruno Haible
d7588ed774 tests: Fix ignore-case failure on several platforms
* tests/ignore-case: Don't compare 'Ⓐ' with 'ⓐ'; this doesn't work on
NetBSD 10.0 and Solaris 11.4. Don't compare 'Ꞻ' with 'ꞻ'; this doesn't
work on CentOS 7, macOS, and Solaris 11 OmniOS.
2024-06-11 15:21:13 -07:00
Paul Eggert
8f8ee60502 maint: port ‘make distcheck’ to Ubuntu 24.04
* configure.ac: Don’t use -Wsystem-headers, as <stdbit.h>
uses static functions that couldn’t be called from
extern inline functions if they were in user code.
2024-06-11 11:59:34 -07:00
Paul Eggert
d82aac15e6 maint: pacify ‘make sc_tight_scope’
Problem reported by Bruno Haible <https://bugs.gnu.org/71455>.
* src/system.h (same_file, stat_size): Add ‘extern’.
2024-06-11 10:11:27 -07:00
Paul Eggert
a9cca43461 maint: port to birthtime platforms
Problem reported by Bruno Haible <https://bugs.gnu.org/71456>.
* src/system.c (same_file): Fix typo on platforms with birthtime.
2024-06-11 09:12:35 -07:00
Paul Eggert
b8b3ac5c20 build: update gnulib submodule to latest 2024-05-21 10:08:53 -07:00
Paul Eggert
ba8e55270f maint: adjust to Gnulib stdbit splitup
* bootstrap.conf (gnulib_modules): Remove stdbit; add stdc_bit_width.
2024-05-16 19:59:49 -07:00
Paul Eggert
8f1af93295 build: update gnulib submodule to latest 2024-05-16 19:59:49 -07:00
Paul Eggert
bf85e93a52 maint: move same_file and stat_size into system.c
Now that we have a system.c, there’s little point to these
being extern inline functions.
* src/system.c (same_file, stat_size): Move here from system.h,
and make them ordinary extern functions.
(proc_dev, symlink_size_ok): Now static, and private to their
functions.
* src/system.h (same_file, stat_size): Now just decls.
2024-05-15 14:13:53 -07:00
Paul Eggert
12dc6b3e6f build: update gnulib submodule to latest 2024-05-15 14:13:53 -07:00
Paul Eggert
62d075ad72 maint: be less fancy when defining extern vars
Bug reported by Bruno Haible in <https://bugs.gnu.org/70951>.
I never did like the XTERN macro and its descendants, as this
“extension” to C causes more confusion than it cures, so let’s
just get rid of it and use plain ‘extern’.
* cfg.mk (_gl_TS_extern): Remove XTERN, SYSTEM_EXTERN.
* src/Makefile.am (cmp_SOURCES, diff3_SOURCES, sdiff_SOURCES)
(diff_SOURCES): Add system.c.
* src/cmp.c, src/diff.c, src/diff3.c, src/sdiff.c (SYSTEM_INLINE):
Remove.
* src/diff.c: Define vars declared in diff.h.
* src/diff.h (DIFF_EXTERN): Remove.  All uses removed.
Just use ‘extern’ when declaring extern vars.
* src/system.h (SYSTEM_EXTERN): Likewise.
* src/system.c: New file.
2024-05-14 15:50:12 -07:00
Paul Eggert
195016c60f build: update gnulib submodule to latest 2024-05-14 15:50:12 -07:00
Paul Eggert
cceca01aba maint: pacify GCC 14 -Wmissing-variable-declarations
* src/Makefile.am (version.c): Have it include version.h,
so that it checks its own interface.
* src/diff.c (DIFF_INLINE): Define this instead of GDIFF_MAIN,
for consistency with SYSTEM_INLINE.
* src/diff.h (DIFF_EXTERN): New macro, replacing XTERN.
All uses changed.  Adjust to GDIFF_MAIN→DIFF_INLINE change.
* src/system.h (SYSTEM_EXTERN): Now takes an argument.
All uses changed.
2024-05-12 08:14:54 -07:00