969 Commits

Author SHA1 Message Date
Jim Meyering
2cd4ff3a5f build: correct man-page generation rule
The PATH was set incorrectly, so that the diff used by
help2man was the one from $PATH, rather than the just-built
one.
* man/Makefile.am (bin_dir): New variable, to...
(dist_man1_MANS): ...prepend ../src to PATH, not just "..".
Also, add a test to ensure that each $(bin_dir)/$$base is
executable, so this doesn't happen again.
In http://debbugs.gnu.org/21023, Rodrigo Valiña
Gutiérrez reported that diff.1 from the diffutils-3.3 tarball
contained no description of the then-new --no-dereference option.
2015-09-01 21:09:10 -07:00
Jim Meyering
5801f8add8 doc: --no-dereference: improve wording/description
* doc/diffutils.texi (Comparing Directories): Correct grammar.
(diff Options) [--no-dereference]: Say a little more.
2015-07-10 09:55:43 -07:00
Jim Meyering
29e8de4885 maint: update copyright year ranges to include 2015; update gnulib 2015-01-01 22:31:27 -08:00
KO Myung-Hun
ec60c3b6d1 diff: skip test if seek is not possible on OS/2 kLIBC
This fixes the problem that 'diff - file' and 'cat file | diff - file'
fail due to a seek failure with a message 'diff.exe: -: Invalid seek',
because seek does not work on stdin and a pipe on OS/2 kLIBC.

* src/io.c (sip): Set skip_test to true if seek is not possible on
OS/2 kLIBC.
2014-12-12 20:51:17 -08:00
Jim Meyering
ecf6a42058 gnulib: update to latest 2014-12-09 07:34:37 -08:00
KO Myung-Hun
3ef90a7e7c build: double-quote use of $PATH
* man/Makefile.am (dist_man1_MANS): On OS/2, PATH_SEPARATOR is ';',
but unquoted, that is interpreted as the shell's statement
terminator.  Quote it.
2014-12-09 07:34:37 -08:00
Paul Eggert
1fa6140faa diff: fix integer overflow problem with --tabsize
Reported by Tobias Stoeckmann in: http://bugs.gnu.org/18857
* src/diff.c (main): Don't overflow if INTMAX_MAX / 2 < tabsize.
* tests/bignum: New file, to test for this bug.
* tests/Makefile.am (TESTS): Add it.
2014-10-27 19:53:44 -07:00
Paul Eggert
df3af29627 doc: mention diff -B fix in NEWS 2014-09-03 16:02:35 -07:00
Paul Eggert
d2fd9d4683 diff: fix bug with diff -B and incomplete lines
Reported by Navin Kabra via Eric Blake in:
http://bugs.gnu.org/18402
* src/util.c (analyze_hunk): Don't mishandle incomplete
lines at end of file.
* tests/no-newline-at-eof: Test for the bug.
2014-09-03 15:59:24 -07:00
Paul Eggert
7bdd6479ce diff: fix performance bug with prefix computation
* src/io.c (find_identical_ends): Fix performance bug:
the test for when the prefix was needed messed up by
the 2002-02-28 integer-overflow fixes, causing performance to be
worse than it needed to be.
2014-09-03 15:59:24 -07:00
Jim Meyering
b6e6912772 gnulib: update to latest, as well as bootstrap 2014-08-23 14:10:43 -07:00
Jim Meyering
cfcba87350 maint: update copyright year range in texinfo documentation
* doc/diffutils.texi: Update copyright.
2014-08-23 14:06:31 -07:00
Jim Meyering
667864f284 maint: update bug-reporting address
* README: Change bug-gnu-utils@... to bug-diffutils@gnu.org.
* doc/diffutils.texi: Likewise.
Reported by Jamie Landeg Jones.
2014-04-15 08:05:55 -07:00
Paul Eggert
f6f1b1b49c diff: fix two "..." typos in --help output
* src/diff.c (option_help_msgid): Remove two "..." typos (Bug#17102).
2014-03-26 11:12:41 -07:00
Paul Eggert
fee3cad6b7 doc: improve documentation about reading and stdin
See Bug#17075.
* doc/diffutils.texi (Comparison): Say that files need not be read.
(Invoking diff): Remove confusing remark about 'diff - -'.
It's not that useful, and it's not portable anyway.
2014-03-25 17:56:14 -07:00
Paul Eggert
ed8975e7de diff, sdiff: minor integer overflow fixes
* src/context.c (find_hunk):
Simplify, now that 2 * context + 1 cannot overflow.
* src/diff.c (main):
* src/sdiff.c (interact):
Don't rely on undefined behavior on signed integer overflow.
* src/diff.c (main): Don't let contexts exceed CONTEXT_MAX.
* src/system.h (CONTEXT_MAX): New macro.
2014-02-24 21:57:35 -08:00
Paul Eggert
c26334b7df diff: fix bug with -I and overlapping hunks
Problem reported by Vincent Lefevre in <http://bugs.gnu.org/16864>.
* src/context.c (find_hunk): Threshold is CONTEXT only if
the second change is ignorable.
* tests/ignore-matching-lines: New test.
* tests/Makefile.am (TESTS): Add it.
2014-02-24 21:57:29 -08: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
bc51e4bcb4 build: update gnulib submodule to latest 2014-02-23 22:50:29 -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
1875453ee6 build: omit -Wsuggest-attribute=pure for lib
* configure.ac (WARN_CFLAGS): Omit -Wsuggest-attribute=pure
when compiling the lib subdirectory.  Reported for Fedora 19
by Eric Blake in <http://bugs.gnu.org/15463>.
2013-09-26 12:20:28 -07:00
Paul Eggert
59f4ef95f8 cmp, diff, sdiff: tune by using rawmemchr
On my platform (AMD Phenom II X4 910e, Fedora 17 x86-64), this sped up
'cmp -n 8GiB /dev/full /dev/zero' by a factor of 3.8, and
'cmp -sn 8GiB /dev/full /dev/zero' by a factor of 1.8.
* bootstrap.conf (gnulib_modules): Add rawmemchr.
* src/cmp.c (cmp): Optimize the common case where buffers are the same,
by using count_newlines rather than block_compare_and_count.
(block_compare_and_count): Remove.
(count_newlines): New function.
* src/cmp.c (count_newlines):
* src/io.c (prepare_text):
* src/sdiff.c (lf_copy, lf_skip, lf_snarf):
Use rawmemchr instead of memchr, for speed.
2013-08-22 15:46:27 -07:00
Paul Eggert
9350980d5d cmp: tune 'cmp a b' for GCC x86
Performance problem reported by David Balažic in:
http://lists.gnu.org/archive/html/bug-diffutils/2013-08/msg00013.html
* src/system.h (word): Make it size_t, not uintmax_t.
This sped up plain cmp 90% on my tests (GCC 4.8.1, x86).
2013-08-12 16:24:24 -07:00
Paul Eggert
8f248489eb build: update gnulib submodule to latest 2013-07-06 17:48:13 -07:00
Stefano Lattarini
d1d1df8e36 build: enable 'subdir-objects' automake option
The future major Automake version (2.0, ETA at least one year from now)
might enable that option unconditionally, so better get prepared in due
time.

* configure.ac (AM_INIT_AUTOMAKE): Adjust.
(AM_PROG_CC_C_O): New, required by Automake up to 1.13.x when the
'subdir-objects' is in use.
2013-05-06 06:12:22 -07:00
Paul Eggert
1280234016 build: update gnulib submodule to latest 2013-04-28 21:00:47 -07: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
Paul Eggert
885dfcec00 diff: remove unnecessary decl
* src/dir.c (compare_names_for_qsort): Remove declaration.
Not needed now that we assume C89.
2013-04-03 08:22:40 -07:00
Paul Eggert
085417c79b diff: tune compare_names_for_qsort
* src/dir.c (compare_collated): New function.
(compare_names): Use it.
(compare_names_for_qsort): Use it.  This is a bit more efficient
as it can avoid a double invocation of file_name_cmp when
file_name_cmp returns zero.
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
Paul Eggert
283d1b9528 tests: port to Solaris 10 /bin/sh
* tests/Makefile.am (TESTS_ENVIRONMENT):
Use "FOO=val; export FOO" rather than "export FOO=val",
as the latter form doesn't work with Solaris /bin/sh.
Problem found when trying to run "make check" on Solaris 10.
2013-03-26 11:39:31 -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.
v3.3
2013-03-24 11:00:34 -07:00
Paul Eggert
6e68271b69 doc: fix menu typo
* doc/diffutils.texi (Comparing Three Files): Fix out-of-order menu.
Bug caught by Texinfo 5.0.
2013-03-23 00:26:39 -07:00
Paul Eggert
0c22f56ed7 maint: update build procedure to recent gettext etc.
* bootstrap.conf (gnulib_modules): Add vararrays.
(needed_gnulib_files, unnecessary_gettext_files): New vars.
(bootstrap_post_import_hook): New function, to implement these vars.
(excluded_files): Remove; 'bootstrap' no longer supports this.
Its function is now performed by unnecessary_gettext_files.
(buildreq): Update automake to 1.12.2, to avoid CVE-2012-3386.
* configure.ac (AM_GNU_GETTEXT_VERSION): Bump from 0.17 to 0.18.2,
to lessen the probability that we'll have outlandishly old files
during a build.
* m4/vararrays.m4: Remove from repository, as we now use the
gnulib version.
2013-03-23 00:26:36 -07:00
Jim Meyering
90fd310a78 build: update gnulib to latest and adapt; update bootstrap, too
Blindly updating to the latest from gnulib, bootstrap would
fail due to failure of our local patches to apply.  Hence,
these first two updates.
* gl/lib/regex_internal.c.diff: Update offsets, so this patch
applies to the latest from gnulib.
* gl/lib/regex_internal.h.diff: Remove file.  No longer needed.
* bootstrap: Update from gnulib.
2013-03-21 21:39:21 -07:00
Paul Eggert
b2f1e4bc55 tests: port to hosts lacking fmt, make -C
* tests/Makefile.am (built_programs): Don't assume fmt works.
Don't rely on 'make -C', either.
2013-01-06 08:31:09 -08:00
Paul Eggert
118d732ab2 maint: update .gitignore for recent gnulib
* .gitignore: Add tests/*.trs and several *.h and *.sed files in lib,
2013-01-06 08:25:34 -08:00
Jim Meyering
45716f1cab build: update gnulib submodule to latest 2013-01-04 11:19:17 +01:00
Jim Meyering
a0483cb2fc maint: update all copyright year number ranges
Run "make update-copyright".
2013-01-04 11:13:02 +01:00
Eric Blake
01d92dba15 build: default to --enable-gcc-warnings in a git tree
Anyone building from cloned sources can be assumed to have a new
enough environment, such that enabling gcc warnings by default will
be useful.  Tarballs still default to no warnings, and the default
can still be overridden with --disable-gcc-warnings.
* configure.ac (gl_gcc_warnings): Set default based on environment.
2012-10-23 11:30:44 +02:00
Paul Eggert
42f6244ee0 * doc/diffutils.texi (cmp Options): Document -l format better. 2012-10-03 21:57:45 -07:00
Jim Meyering
221383bcb1 maint: use xasprintf in place of xmalloc+sprintf
* bootstrap.conf (gnulib_modules): Add gnulib's xvasprintf module.
* src/util.c: Include "xvasprintf.h".
(begin_output): Use xasprintf in place of xmalloc+sprintf.
2012-09-10 14:31:35 +02:00
Andreas Gruenbacher
e17295dc55 diff: encode file names with special characters
* src/util.c (c_escape_char): New function.
(c_escape): New function.
(begin_output): Escape file names when needed.
* src/context.c (print_context_header): New names parameter.
(print_context_label): New name parameter.
* src/diff.h (print_context_header): Change prototype.
* tests/filename-quoting: New file.
* NEWS: Document this change.
2012-09-10 14:31:23 +02:00
Paul Eggert
baeaa83e31 diff: silence GCC warning instead of slowing down
* src/dir.c (find_dir_file_pathname): Use 'IF_LINT (volatile)' to
silence the gcc warning, rather than using 'volatile', as the
warning appears to be bogus.
2012-08-30 07:52:46 -07:00
Jim Meyering
f6ac439e48 diff: avoid possible longjmp-triggered misbehavior
* src/dir.c (find_dir_file_pathname): gcc 4.8.0 20120825 reported
that a local variable's value might be clobbered.  Declare "match"
to be volatile.
2012-08-28 10:59:03 +02:00
Jim Meyering
6c273a4db6 build: update gnulib, bootstrap and init.sh to latest 2012-08-28 10:59:03 +02:00
Jim Meyering
5cb0eea638 maint: avoid new syntax-check failure due to @xref use
* doc/diffutils.texi: Change several "; @xref{..." to ".  @xref{...",
since @xref should start a sentence.
2012-08-28 10:59:03 +02:00
Paul Eggert
1f281b3680 maint: remove ms subdirectory
diffutils is now designed to build with Cygwin or MinGW.
The old DJGPP stuff probably doesn't work anyway.
* Makefile.am (SUBDIRS): Remove ms.
* NEWS: Document this.
* configure.ac (AC_CONFIG_FILES): Remove ms/Makefile.
* ms/Makefile.am, ms/README, ms/config.bat, ms/config.sed:
* ms/config.site: Remove.
2012-05-15 14:01:53 -07:00
Paul Eggert
bca6d67e3f maint: update bootstrap from gnulib
* bootstrap: Update from gnulib.
2012-05-14 23:25:14 -07:00