937 Commits

Author SHA1 Message Date
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
Paul Eggert
3549f733b9 main: port subcommands to mingw
Problem reported by Eli Zaretskii in
<http://lists.gnu.org/archive/html/bug-gnu-utils/2012-05/msg00013.html>.
Approach suggested by Bruno Haible as option (4) in
<http://lists.gnu.org/archive/html/bug-gnu-utils/2012-05/msg00036.html>.
* bootstrap.conf (gnulib_modules): Add system-quote.
* src/diff3.c, src/sdiff.c, src/util.c:
Include <system-quote.h>, not <sh-quote.h>.
* src/diff3.c (read_diff):
* src/sdiff.c (main, edit):
* src/util.c (begin_output):
Use system_quote_argv, for portability to Mingw.
* src/sdiff.c (NUM_SIGS, handler_index_of_SIGINT): Now enum
values, not macros; this is cleaner and avoids a GCC warning if
!HAVE_WORKING_VFORK.
* src/util.c (begin_output) [! HAVE_WORKING_FORK]: Do not use -f,
for consistency with the HAVE_WORKING_FORK code.
2012-05-14 23:08:59 -07:00
Paul Eggert
de512b8345 maint: update bootstrap from gnulib
* bootstrap: Update from gnulib.
2012-05-14 23:08:59 -07:00
Paul Eggert
98985d3206 maint: m4/gnulib-cache.m4 is not under version control
This is like what coreutils does, and suppresses 'git status' chatter.
* .gitignore: Add /m4/gnulib-cache.m4.
2012-05-14 23:08:59 -07:00
Paul Eggert
e537e2c866 Use binary mode when testing for binary files.
This reverts the 2006-01-05 change and modernizes to the current API.
Idea suggested by Eli Zaretskii in:
http://lists.gnu.org/archive/html/bug-gnu-utils/2012-05/msg00066.html
* src/cmp.c (main):
* src/diff.c (main, compare_files):
Use set_binary_mode rather than SET_BINARY.
* src/diff.c (compare_files): Omit unnecessary use of O_BINARY.
* src/io.c (sip): Sample unknown files in binary mode, to see
whether they are binary.
(read_files): Read binary files in binary mode.
2012-05-14 10:23:16 -07:00
Paul Eggert
aa7a1de25a build: update gnulib submodule to latest 2012-05-14 10:15:56 -07:00
Stefano Lattarini
5f295d6115 build: omit obsolete AM_PROG_CC_STDC macro
The Automake-provided macro 'AM_PROG_CC_STDC' has been superseded by
the Autoconf-provided one 'AC_PROG_CC' since October 2002, and will
be removed in the next major automake version.
* configure.ac (AM_PROG_CC_STDC): Drop it.
2012-05-13 19:47:01 -07:00
Jim Meyering
3c19ca08b1 diff: fix a typo that was always disabling the same_special_file macro
* src/system.h (same_special_file): Correct cpp guard expression:
s/HAVE_ST_RDEV/HAVE_STRUCT_STAT_ST_RDEV/.  Reported by Eli Zaretskii.
2012-05-05 15:53:20 +02:00
Jim Meyering
6cb7786fd8 maint: update bootstrap from gnulib
* bootstrap: Update from gnulib.
2012-04-17 11:46:28 +02:00
Eric Blake
2f108d7405 usage: improve wording of --ignore-matching-lines
* src/diff.c (option_help_msgid): Tweak wording.
2012-03-07 09:13:10 -07:00
Paul Eggert
c7560370da doc: explain -I RE better in --help output
* src/diff.c, src/sdiff.c (option_help_msgid): For -I RE,
change "whose lines all match" to "all whose lines match" to avoid
unintended interpretation.  Reported by Danijel Tasov in
<http://bugs.debian.org/648411>.
2012-03-04 13:21:50 -08:00
Paul Eggert
b2892140d8 sdiff: remove dependency on sigprocmask
* bootstrap.conf (gnulib_modules): Remove sigprocmask.
* src/sdiff.c (temporary_file): No need to invoke sigprocmask
here, since the signal handler merely sets a flag.
2012-02-12 13:08:50 -08:00
Paul Eggert
7f2f4bb365 diff: -N, --unidirectional-new-file now compare to "-" too
* NEWS: Document this.
* doc/diffutils.texi (Comparing Directories): Likewise.
Also, document that these options work at the top level.
* src/diff.c (compare_files): Treat EBADF like ENOENT, to handle
the case where "-" is closed.  Allow the other file to be
STDIN_FILENO, in case it's "-".
* tests/Makefile.am (TESTS): Add new-file.
* tests/new-file: New file.
2012-02-04 22:13:48 -08:00
Paul Eggert
62ca21c8c1 maint: quote 'like this' or "like this", not `like this'
This is in response to a recent change in the GNU coding standards,
which now suggest quoting 'like this' or "like this", instead of
`like this' or ``like this''.
* HACKING, NEWS, README, README-hacking, TODO, doc/diagmeet.note:
* doc/diffutils.texi, ms/config.bat, ms/config.site:
* src/analyze.c, src/cmp.c, src/context.c, src/diff.c:
* src/diff.h, src/diff3.c, src/dir.c, src/ifdef.c, src/io.c:
* src/sdiff.c, src/side.c, src/system.h, src/util.c:
* tests/help-version:
Quote 'like this' or "like this" in commentary.
* cfg.mk (old_NEWS_hash): Adjust to reflect new NEWS quoting.
* man/help2man: Update to 1.40.4 version, with quoting fixed as above.
* po/en.po: Remove translation involving `, as it's no longer needed.
* src/cmp.c (try_help, specify_ignore_initial, usage, main):
* src/diff.c (main, try_help, option_help_msgid, specify_value)
(compare_files):
* src/diff3.c (main, try_help, option_help_msgid, usage)
(read_diff):
* src/dir.c (compare_names):
* src/sdiff.c (try_help, usage, check_child_status, main):
* src/util.c (finish_output):
* tests/help-version:
Quote 'like this' in output.
2012-01-25 23:54:38 -08:00
Paul Eggert
70eafb8038 build: update gnulib submodule to latest 2012-01-25 23:54:37 -08:00
Jim Meyering
301a23cdbb build: accommodate newer bootstrap from gnulib
* bootstrap.conf (gnulib_tool_option_extras): Add both --symlink
and --makefile-name=gnulib.mk.  Also remove now-obsolete $bt/ prefix.
* bootstrap: Update from gnulib.
* tests/init.sh: Update from gnulib.
* lib/Makefile.am: Initialize numerous variables, so that
generated code in gnulib.mk may use += to append to them.
2012-01-12 14:04:44 +01:00
Jim Meyering
6e51ccfb4e maint: avoid new syntax-check failure
* src/diff.c (compare_files): Use STREQ, not strcmp.
2012-01-12 14:04:44 +01:00
Bruno Haible
e3324651cc New option --no-dereference.
* src/diff.h (no_dereference_symlinks): New variable.
* src/diff.c: Include xreadlink.h.
(longopts): Add --no-dereference option.
(main): Accept --no-dereference option.
(option_help_msgid): Mention the --no-dereference option.
(compare_files): If no_dereference_symlinks is true, use lstat()
instead of stat(). Compare symbolic links by comparing their values.
* bootstrap.conf (gnulib_modules): Add lstat, stat, xreadlink.
* doc/diffutils.texi (Comparing Directories, diff Options): Mention the
--no-dereference option.
* tests/no-dereference: New file.
* tests/Makefile.am (TESTS): Add it.
2012-01-08 21:26:27 +01:00
Jim Meyering
45110a7927 maint: update all copyright year number ranges
Run "make update-copyright".
2012-01-01 09:32:41 +01:00
Jim Meyering
c88c3b6b2a build: update to latest gnulib and adapt
* tests/binary: Reverse arguments to compare to avoid failure of
new syntax-check rule.
* configure.ac: Use -Wno-format-nonliteral.
Mark functions as pure of const, per recommendations enabled by
new gcc -W options.  Use _GL_ATTRIBUTE_PURE and _GL_ATTRIBUTE_CONST.
* lib/cmpbuf.h (buffer_lcm, block_compare):
Apply pure and/or const attributes.
* src/cmp.c (block_compare): Likewise.
* src/context.c (find_hunk): Likewise.
* src/diff.h (lines_differ): Likewise.
* src/diff3.c (skipwhite): Likewise.
* src/dir.c (dir_loop): Likewise.
* src/util.c (find_change, find_reverse_change): Likewise.
(translate_line_number): Likewise.
2011-12-14 15:07:57 +01:00
Jim Meyering
439286a937 build: stop distributing gzip'd releases; xz is enough
* configure.ac (AM_INIT_AUTOMAKE): Add no-dist-gzip.
2011-12-14 14:27:28 +01:00
Jim Meyering
31b43733d4 tests: use "compare exp out", not "compare out exp"
Likewise, when an empty file is expected, use "compare /dev/null out",
not "compare out /dev/null". I.e., specify the expected/desired contents
via the first file name.  Prompted by a suggestion from Bruno Haible
in http://thread.gmane.org/gmane.comp.gnu.grep.bugs/4020/focus=29154

Run these commands:

  git grep -l -E 'compare [^ ]+ exp' \
    |xargs perl -pi -e 's/\b(compare) (\S+) (exp\S*)/$1 $3 $2/'
  git grep -l -E 'compare [^ ]+ /dev/null' \
    |xargs perl -pi -e 's,\b(compare) (\S+) (/dev/null),$1 $3 $2,'

But manually convert this one:

  -compare out exp-$(echo $opt|tr ' ' _)
  +compare exp-$(echo $opt|tr ' ' _) out

and avoid an inappropriate change to cfg.mk.
2011-11-29 17:17:10 +01:00
Stefano Lattarini
5e2baecb26 tests: use more portable fd redirection in TESTS_ENVIRONMENT
* tests/Makefile.am (TESTS_ENVIRONMENT): Redirection with `exec 9>&2'
is not portable to various Korn shells, and to (at least) HP-UX 11
/bin/sh.  Use a more portable idiom.
See http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/22488 for
lots of discussion.
2011-10-12 19:46:13 +02:00
Stefano Lattarini
366adeb73d tests: make test runner a script, not a shell function
All the test scripts in the diffutils testsuite are shell scripts,
so the current definition of TESTS_ENVIRONMENT, which adaptively
run tests using either perl or the shell depending on their kind,
is an overkill.

Moreover, this change is required in order for the testsuite to
continue to work with the new testsuite harness that is planned
to be introduced in Automake 1.12 (which, as of the writing date,
is still under development and in late alpha state).

See also related discussion on bug-coreutils:
 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8887>

* tests/Makefile.am (TESTS_ENVIRONMENT): Remove definition of the
`shell_or_perl_' shell function, which is not required anymore.
(LOG_COMPILER): New, define to `$(SHELL)'.
* tests/binary: Make executable.
* tests/colliding-file-names: Likewise.
* tests/excess-slash: Likewise.
* tests/no-newline-at-eof: Likewise.
2011-10-11 16:40:12 +02:00
Claudio Bley
7508234eab portability: use SET_BINARY rather than xfreopen (NULL, ...
* src/diff.c: Include binary-io.h, not xfreopen.h.
(main): Use SET_BINARY (...) rather than xfreopen (NULL, X, ...),
because the latter doesn't work on MinGW and crashes using MSVC.
* src/cmp.c (main): Likewise.
2011-10-04 13:55:49 +02:00
Jim Meyering
11ef88af92 build: update gnulib submodule to latest 2011-10-04 13:40:21 +02:00
Jim Meyering
57a09576e8 post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2011-09-02 17:21:07 +02:00
Jim Meyering
8f14bb9095 version 3.2
* NEWS: Record release date.
v3.2
2011-09-02 17:18:34 +02:00
Jim Meyering
e2ed9d279b build: update bootstrap and tests/init.sh from gnulib
* bootstrap: Update from gnulib.
* tests/init.sh: Likewise.
2011-09-02 14:16:04 +02:00
Jim Meyering
783eca9655 build: update gnulib submodule to latest 2011-09-02 14:10:10 +02:00
Jim Meyering
77bcc326cc doc: diffutils' texi-derived doc may now be in debian's "main" section
* NEWS (Packaging): Mention the "no front/back-cover" change.
2011-09-02 00:36:16 +02:00
Jim Meyering
320355d6d4 maint: avoid new "make sytnax-check" failure.
* src/diff.h (find_dir_file_pathname): Mark declaration with "extern"
keyword, in order to placate the tight-scope syntax check.
2011-08-15 07:27:14 +02:00
Paul Eggert
8739d45f72 * src/io.c (find_and_hash_each_line): Refactor for brevity. 2011-08-14 22:09:22 -07:00