104 Commits

Author SHA1 Message Date
Jim Meyering
b1a657b85a version 3.10
* NEWS: Record release date.
2023-05-21 01:50:39 -07:00
Carlo Marcelo Arenas Belón
13a05d1e95 gnulib: fix Y2038 bug (again)
AC_SYS_LARGEFILE meaning has changed, need AC_SYS_YEAR2038 as well

* NEWS: mention this
* tests: add test
* bootstrap.conf: add year2038

Copyright-paperwork-exempt: yes
2023-05-13 22:23:57 -07:00
Paul Eggert
ba08fbbb0c diff: fix bug where -D does not work
Problem reported by Robert Webb (bug#61193).
* NEWS: Mention this.
* src/diff.c (main): Omit stray ‘sizeof’.
* tests/ifdef: New test.
* tests/Makefile.am (TESTS): Add it.
2023-02-10 15:44:38 -08:00
Jim Meyering
aa13187f2a maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2023-01-15 13:25:29 -08:00
Jim Meyering
89b587f03f version 3.9
* NEWS: Record release date.
2023-01-15 13:20:24 -08:00
Jim Meyering
47a1f46f08 maint: update copyright dates 2023-01-01 17:19:37 -08:00
Jim Meyering
aec523d3a4 maint: make update-copyright 2022-01-03 11:49:11 -08:00
Paul Eggert
074cbe590b diff: fix timezone bug on Solaris
Problem reported by Vladimir Marek (bug#51228).
* NEWS: Mention this.
* src/context.c (print_context_label): Pass localtz to nstrftime,
instead of always passing 0.
* src/diff.c (main) [!HAVE_TM_GMTOFF]:
Initialize localtz if time_format uses %z.
* src/diff.h (localtz): New decl.
* tests/Makefile.am (TESTS): Add timezone.
* tests/timezone: New test.
2021-10-15 18:54:49 -07:00
Jim Meyering
3065d7421c maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2021-08-01 18:58:42 -07:00
Jim Meyering
42868488c7 version 3.8
* NEWS: Record release date.
2021-08-01 18:55:07 -07:00
Jim Meyering
22fb055cca maint: update all copyright year number ranges
Run "make update-copyright" and then...
* gnulib: Update to latest with copyright year adjusted.
* tests/init.sh: Sync with gnulib to pick up copyright year.
* bootstrap: Likewise.
2021-01-01 17:37:49 -08:00
Jim Meyering
351f87d0c4 maint: update all copyright year number ranges
Run "make update-copyright" and then...
* gnulib: Update to latest with copyright year adjusted.
* tests/init.sh: Sync with gnulib to pick up copyright year.
* bootstrap: Likewise.
2020-01-01 09:33:03 -08:00
Paul Eggert
8d26b1403e diff: don’t mistreat -N in arg as a large number
Problem reported by alec (Bug#35256).
* NEWS: Mention the fix.
* bootstrap.conf (gnulib_modules): Use strtoimax and xstrtoimax,
not strtoumax and strtoumax.
* src/cmp.c (bytes): Now signed, with -1 representing no limit.
All uses changed.
* src/cmp.c (specify_ignore_initial, main):
* src/diff.c (main):
* src/ifdef.c (format_group):
* src/sdiff.c (interact):
Use strtoimax, not strtoumax.
2019-08-27 16:17:08 -07:00
Jim Meyering
badccffea4 maint: convert all TABs to equivalent spaces in indentation
Using this file,

cat > leading-blank.exempt <<\EOF
(\.gitmodules|help2man|pre-commit)$
(?:^|\/)ChangeLog[^/]*$
(?:^|\/)(?:GNU)?[Mm]akefile[^/]*$
\.(?:am|mk)$
EOF

run the following command to convert all non-conforming leading white
space to be all spaces:

git ls-files \
  | pcregrep -vf leading-blank.exempt \
  | xargs pcregrep -l '^ *\t' \
  | xargs perl -MText::Tabs -ni -le \
    '$m=/^( *\t[ \t]*)(.*)/; print $m ? expand($1) . $2 : $_'

Since that changed old NEWS, I also ran "make update-NEWS-hash"
to update the old_NEWS_hash value in cfg.mk.
2019-01-05 22:47:23 -08:00
Paul Eggert
601eceb57c diff: fix cmp, diff3, sdiff with stdin closed
* NEWS: Mention this.
* src/cmp.c, src/diff3.c, src/sdiff.c: Include stdopen.h.
(main): Call stdopen early.
* src/cmp.c (main): Simplify now that we need not worry about
stdin being closed.
* src/diff.c (main): Translate stdopen diagnostic.
2019-01-05 20:02:02 -08:00
Paul Eggert
2c9d956aac diff: remove unportable ‘diff -N - f <&-’ feature
* NEWS: Mention this.
* bootstrap.conf (gnulib_modules): Add stdopen.
* doc/diffutils.texi (Comparing Directories):
Do not document behavior if stdin is closed.
* src/diff.c: Include stdopen.h.
(main): Call stdopen early.
(compare_files) [__hpux]: Remove recently-introduced
special case for HP-UX exec with stdin closed.
* tests/new-file: Remove tests of the removed feature.
2019-01-05 19:20:36 -08:00
Jim Meyering
197d7d492f maint: update all copyright dates via "make update-copyright"
* gnulib: Also update submodule for its copyright updates.
2019-01-01 19:02:28 -08:00
Jim Meyering
70d787ef44 maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2018-12-31 17:58:56 -08:00
Jim Meyering
2de623e7a1 version 3.7
* NEWS: Record release date.
2018-12-31 17:56:36 -08:00
Dennis Lambe Jr
aaf0efa70d diff: adjust ANSI escapes for compatibility with less -R
GNU less can display ANSI-colored text with the -R flag, but this
support has some limitations. One of them is that if an escape
sequence starts on one line and ends on a different line, only the
first line will be colored in less.

As a result, when diff creates colored output with multi-line deletes
or adds, less will only color the first line.

This change resets ANSI color to the default at the end of
each line and restarts it at the beginning of the next. It patches
normal and context mode. Side-by-side already worked in my testing.
* src/context.c (print_context_label, pr_context_hunk): As above.
(pr_unidiff_hunk, print_context_header): Likewise.
* src/normal.c (print_normal_hunk): Likewise.
* tests/colors: Adjust existing tests to accommodate this.
* NEWS (Improvements): Mention it.
Proposed in http://bugs.gnu.org/31105
2018-12-30 22:22:10 -08:00
Paul Eggert
f878003953 diff: fix UMR with --strip-trailing-cr
Problem reported by Hongxu Chen (Bug#31935).
* src/io.c (prepare_text): Strip trailing CR before
doing the rest of the analysis.
* NEWS: Mention the fix.
Co-authored-by: Jim Meyering <jim@meyering.net>
2018-12-28 19:08:16 -08:00
Jim Meyering
4a38f715f1 maint: update gnulib and copyright dates for 2018
* gnulib: Update to latest.
* all files: Run "make update-copyright".
* bootstrap: Update from gnulib.
2018-01-06 16:51:19 -08:00
Jim Meyering
592e503b48 maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2017-05-21 13:27:36 -07:00
Jim Meyering
e73a3d5e44 version 3.6
* NEWS: Record release date.
2017-05-21 13:25:42 -07:00
Paul Eggert
1b1526b4f5 cmp: report prefix length when one file is shorter
Requested by Dan Jacobson (Bug#22816).
* NEWS:
* doc/diffutils.texi (Invoking cmp, cmp Options): Document this.
* src/cmp.c (cmp): Implement it.
* tests/Makefile.am (TESTS): Add cmp.
* tests/cmp: New file.
2017-05-04 17:54:46 -07:00
Jim Meyering
4e40686e23 tests: add test for latest fix
* NEWS (Bug fixes): Describe it.
* tests/invalid-re: New test for just-fixed bug.
* tests/Makefile.am (TESTS): Add it.
2017-05-02 20:00:50 -07:00
Jim Meyering
affa30def0 maint: add "introduced in 3.4" in latest NEWS entry
* NEWS: Update.  Also, thanks to Nelson Beebe for reporting this.
2017-01-31 17:06:10 -08:00
Jim Meyering
eaa2a24345 diff: avoid UMR with ---presume-output-tty
* src/diff.c (main): Always define presume_output_tty.
Otherwise, it would be read uninitialized.
Introduced in v3.3-45-g17e2698
* NEWS (Bug fixes): Mention it.
2017-01-31 16:46:17 -08:00
Jim Meyering
75173432ed maint: change "time stamp" to "timestamp" globally
This avoids a new syntax-check failure.
* ChangeLog-2008: Perform that change.
* doc/diffutils.texi: Likewise.
* NEWS: Likewise.
* cfg.mk: Update the old news hash accordingly.
2017-01-31 10:45:20 -08:00
Jim Meyering
90106d33ab maint: update gnulib and copyright dates for 2017
* gnulib: Update to latest.
* all files: Run "make update-copyright".
2017-01-01 03:22:44 -08:00
Paul Eggert
68b82f6f84 diff: fix big performance degradation in 3.4
* NEWS, doc/diffutils.texi (Overview): Document this.
* src/analyze.c (diff_2_files): Restore too_expensive heuristic,
but this time with a floor that is 16 times the old floor.  This
should fix Bug#16848, by generating good-quality output for its
test case, while not introducing Bug#24715, by running nearly as
fast as diff-3.3 for that test case.
2016-10-25 21:58:31 -07:00
Paul Eggert
f2712fcddf diff: port line numbers to mingw64
Problem reported by Peter Rosin (Bug#24311).
* src/system.h (printint, pI): New typedef and macro.
All uses of 'long int' and "%l" in printf format replaced by
'printint' and "%"pI respectively.
* src/ifdef.c (do_printf_spec): Don't assume pI is length 1.
2016-08-27 15:01:41 -07:00
Jim Meyering
34823e7e67 maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2016-08-20 22:23:28 -07:00
Jim Meyering
d1145efd81 version 3.5
* NEWS: Record release date.
2016-08-20 22:21:26 -07:00
Bastian Beischer
1a0df4396e diff3: fix heap use-after-free; add minimal diff3 test coverage
Commit v3.3-42-g3b74a90, "FIXME: src/diff3: plug a leak" added an
invalid use of free, leading to use-after-free in nearly any invocation
of diff3.  Revert that commit.
* NEWS (Bug fixes): Mention it.
* tests/diff3: New file, to add minimal test coverage.
* tests/Makefile.am (TESTS): Add it.
Reported by Bastian Beischer in http://bugs.gnu.org/24210
2016-08-13 21:56:14 -07:00
Jim Meyering
697c1f4fa9 diff: disable colorization for TERM=dumb
* src/diff.c (main): With --color or --color=auto, when TERM is
"dumb", disable colorization.  Suggested by Daniel Colascione.
* NEWS (Bug fixes): Mention it.
* tests/colors: Add a test that would fail without this change,
yet passes with it.
2016-08-08 18:53:32 -07:00
Jim Meyering
0936993252 maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2016-08-08 10:14:00 -07:00
Jim Meyering
5ac64141ed version 3.4
* NEWS: Record release date.
2016-08-08 10:10:51 -07:00
Jim Meyering
7346a03010 maint: update copyright year, bootstrap, init.sh
Run "make update-copyright" and then...

* gnulib: Update to latest.
* tests/init.sh: Update from gnulib.
* bootstrap: Likewise.
2016-01-01 18:00:08 -08:00
Jim Meyering
a3ea9cd5cb diff --brief no longer mistakenly reports diff. with 0-sized /proc/ files
Normally, it is safe to assume two regular files are different when
their st_size values are different.  However, that assumption may
be invalid if either value is zero, as happens with files on Linux
/proc and /sys file systems. Since skipping this optimization will
usually cost very little (one read syscall, to read zero bytes),
it is fine to accommodate those unusual files.
* src/analyze.c (diff_2_files): Do not assume regular files differ
just because their st_size values differ when one or more is 0.
* src/diff.c (compare_files): Likewise.
* tests/brief-vs-proc-stat-zero: New test.
* tests/Makefile.am: Add it.
* NEWS (Bug fixes): Describe it.
Reported by Stephan Müller in http://debbugs.gnu.org/21942
2015-12-06 11:37:44 -08:00
Giuseppe Scrivano
0e72de4795 doc: mention --color and --palette in NEWS 2015-11-29 08:20:53 -08:00
Jim Meyering
29e8de4885 maint: update copyright year ranges to include 2015; update gnulib 2015-01-01 22:31:27 -08:00
Paul Eggert
df3af29627 doc: mention diff -B fix in NEWS 2014-09-03 16:02:35 -07:00
Paul Eggert
9b48bf3d3e diff: remove TOO_EXPENSIVE heuristic
Problem reported by Vincent Lefevre in <http://bugs.gnu.org/16848>.
The simplest solution is to remove the TOO_EXPENSIVE heuristic
that I added to GNU diff in 1993.  Although appropriate for
circa-1993 hardware, these days the heuristic seems to be more
trouble than it's worth.
* NEWS: Document this.
* doc/diffutils.texi (Overview): Modernize citations.
Remove mention of TOO_EXPENSIVE heuristic.
* src/analyze.c (diff_2_files): Adjust to TOO_EXPENSIVE-related
API changes in gnulib's diffseq module.
2014-02-23 22:50:37 -08:00
Paul Eggert
bc4b4b2bbf diff: exit with status 1, not 2, when binary files differ
Problem reported by Vincent Lefevre in <http://bugs.gnu.org/16608>.
* NEWS:
* doc/diffutils.texi (Binary, Invoking diff): Document this.
* src/analyze.c (briefly_report): Return void, not int.
All uses changed.  Do not futz with exit status.  Simplify.
* tests/binary: Adjust to match new behavior.
2014-01-31 17:15:54 -08:00
Paul Eggert
4825b8d70c diff: fix bug with Asian file names
Problem reported by Errembault Philippe in:
http://lists.gnu.org/archive/html/bug-diffutils/2013-03/msg00012.html
* NEWS: Document this.
* src/dir.c (compare_names): Fall back on file_name_cmp if
compare_collated returns 0, unless ignoring file name case.
(diff_dirs): Don't bother with the O(N**2) stuff unless ignoring
file name case.
* tests/Makefile.am (TESTS): Add strcoll-0-names.
* tests/strcoll-0-names: New file.
2013-04-03 08:22:40 -07:00
Jim Meyering
417363e4ce doc: mention new option, --no-dereference in 3.3's NEWS
* NEWS (New feeatures): Update 3.3's news to mention --no-dereference.
Reported by Denis Excoffier.
* Makefile.am (old_NEWS_hash): Update, since this modifies old, and
normally-immutable NEWS.
2013-03-30 14:04:56 -07:00
Jim Meyering
3667192611 maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2013-03-24 11:09:13 -07:00
Jim Meyering
4544aa68fd version 3.3
* NEWS: Record release date.
2013-03-24 11:00:34 -07:00
Jim Meyering
a0483cb2fc maint: update all copyright year number ranges
Run "make update-copyright".
2013-01-04 11:13:02 +01:00