1039 Commits

Author SHA1 Message Date
Jim Meyering
e73a3d5e44 version 3.6
* NEWS: Record release date.
v3.6
2017-05-21 13:25:42 -07:00
Jim Meyering
7c2a2d63f4 gnulib: update to latest 2017-05-19 17:14:09 -07:00
Jim Meyering
d3b51e7f02 maint: update to work with GCC7's -Werror=implicit-fallthrough=
* src/system.h (FALLTHROUGH): Define.
Use new FALLTHROUGH macro in place of comments
* src/cmp.c: FIXME
* src/diff3.c: FIXME
* src/ifdef.c: FIXME
* src/sdiff.c: FIXME
* src/side.c: FIXME
* src/util.c: FIXME
2017-05-18 10:39:59 -07:00
Jim Meyering
646268f5c6 gnulib: update to latest 2017-05-18 10:39:59 -07:00
Jim Meyering
20b31314c3 tests: new-file: closed-stdin: also ensure stdout was empty
* tests/new-file: Also require that "out" be empty.
2017-05-09 11:55:46 -07:00
Jim Meyering
c881afb9b8 maint: stop using @acronym{...} in texinfo sources
* doc/diffutils.texi: Remove all uses of @acronym{...},
per recommendation by Karl Berry.
* cfg.mk (local-checks-to-skip): Remove exemption, enabling
the @acronym{-prohibiting syntax-check rule.
2017-05-06 12:24:42 -07:00
Paul Eggert
ac05c6d549 cmp: improve EOF diagnostic
This improves on yesterday's change, following up on a
remark by Jim Meyering (Bug#22816#21).
* doc/diffutils.texi (Invoking cmp, cmp Options): Follow POSIX more
closely in the documentation of the information appended to the EOF
diagnostic.
* src/cmp.c (cmp): Be more specific about the shorter file's length
and fix some off-by-1 issues in reporting line counts.
* tests/cmp: Adjust to match new behavior.
Don't assume internal details about stdio buffering.
2017-05-05 07:57:05 -07:00
Benno Schulenberg
98b6fc2f32 diff: describe each --help option with a single string
* src/diff.c: To ease translating, fuse four description pieces
into two whole ones.  Also reword and rewrap one of them to fit
within eighty characters.
2017-05-04 22:37:44 -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
af6d2e0dbd gnulib: update to latest 2017-05-02 19:59:31 -07:00
Paul Eggert
2acb5aae86 diff: don't crash if regexp is invalid
Problem reported by Marcel Böhme in:
http://lists.gnu.org/archive/html/bug-diffutils/2017-04/msg00002.html
* src/diff.c (add_regexp): Exit if re_compile_pattern fails.
2017-04-27 22:39:59 -07:00
julama
7c636563c2 tests: avoid false failure for unreadable /proc/cmdline
* tests/brief-vs-stat-zero-kernel-lies: Use "test -r" rather than
just "test -f".  This avoids a false test failure on a linux system
with grsecurity and its GRKERNSEC_PROC_USER option enabled, for which
/proc/cmdline is unreadable.  Reported in https://bugs.gnu.org/26155
2017-03-24 12:43:18 -07:00
Jim Meyering
198c55a645 tests: avoid false failure with some shells on debian, freebsd
* tests/colors: Move the TERM=dumb setting into the code run by
"returns_", since some shells do not propagate envvar setting through
to a use of a function like this.  That would cause this test to fail
because results were colorized when they should not have been.
Reported by Nelson Beebe.
2017-02-01 23:06:29 -08: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
8420aff7e0 gnulib: update to latest; and update bootstrap and init.sh 2017-01-31 10:45:20 -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
Jim Meyering
a9cc55101c tests: use "returns_" rather than explicit comparison with "$?"
* tests/colors: Use "returns_ 1" rather than testing $? = 1
* tests/basic: Likewise.
* tests/binary: Likewise.
* tests/filename-quoting: Likewise.
* tests/function-line-vs-leading-space: Likewise.
* tests/ignore-matching-lines: Likewise.
* tests/label-vs-func: Likewise.
* tests/new-file: Likewise.
* tests/no-dereference: Likewise.
* tests/no-newline-at-eof: Likewise.
* tests/stdin: Likewise.
2016-11-08 18:28:04 -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
571f01c069 build: update gnulib submodule to latest 2016-10-25 21:58:31 -07:00
Jim Meyering
1c1de41860 maint: use die rather than error
Use "die (N, ..." rather than "error (N, ..." whenever N is a nonzero
constant.  That lets the compiler know that control never goes beyond
that point, and thus makes unnecessary the occasional following
"abort ();" or "break;" statement we have historically added to inform
static analysis tools of this aspect of "error" semantics.
* src/die.h: New file.
* src/Makefile.am (noinst_HEADERS): Add it.
* src/cmp.c: Use die in place of error whenever the first
argument is a nonzero constant.  Also remove any immediately-
following call to abort, and include "die.h".
* src/diff.c: Likewise.
* src/diff3.c: Likewise.
* src/sdiff.c: Likewise.
* src/util.c: Likewise.
2016-10-16 16:47:04 -07:00
Jim Meyering
84387b8f5f gnulib: update to latest 2016-10-02 12:14:22 -07:00
Jim Meyering
8db62fe5ec build: avoid GCC 7's new warnings
* src/util.c (get_funky_string): Adjust comment so that GCC 7's
-Wimplicit-fallthrough recognizes it.
* src/diff3.c (main): Cast boolean MERGE to "int" to avoid this:
diff3.c:341:25: error: '~' on a boolean expression \
[-Werror=bool-operation]
2016-10-02 12:14:03 -07:00
Jim Meyering
ff2b22a8b3 gnulib: update to latest 2016-08-30 12:41:38 -07:00
Jim Meyering
65185e4c62 gnulib: update to latest, to port to upcoming GCC 7
This fixes compilation errors when using gcc-7-to-be that were
due to missing backslashes in gnulib's intprops.h and an API
change in functions like __builtin_add_overflow.  This ports
to GCC 7's newer built-in overflow-checking functions.
2016-08-29 20:08:51 -07:00
Paul Eggert
688f4fb211 diff: don't assume ptrdiff_t <= long long int
* src/system.h (printint, pI): Port to (theoretical) platforms
where ptrdiff_t is wider than long long int (Bug#24311).
2016-08-28 16:47:13 -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.
v3.5
2016-08-20 22:21:26 -07:00
Jim Meyering
24792668f0 build: arrange to build with -fno-common, when possible
* configure.ac (WERROR_CFLAGS): Add -fno-common, when possible.
This would have prevented the duplicate definition of
presume_output_tty that was fixed in v3.4-10-gc2dc91f.
2016-08-16 22:20:28 -07:00
Hanno Böck
c2dc91f196 diff: avoid duplicate definition of presume_output_tty
* src/util.c (presume_output_tty): Remove this definition.
The other is in diff.h.  Reported in https://bugs.gnu.org/24248
2016-08-16 22:02:13 -07:00
Jim Meyering
d6474c4c51 gnulib: update to latest 2016-08-14 22:28:38 -07:00
Jim Meyering
c61efccd23 tests: diff3: work around missing seq on some systems
* tests/diff3 (seq): Provide a seq replacement function,
since at least AIX, SunOS 5.10, OpenBSD-5.8 lack it.
Reported by Assaf Gordon in https://bugs.gnu.org/24227#8
2016-08-14 22:25:49 -07:00
Jim Meyering
edd942ca27 diff3: fix leaks, for real
* src/diff3.c (struct diff_block)[lint]: Add member, n2.
(free_diff_block, next_to_n2): New functions.
* tests/diff3: Add more test coverage.
2016-08-13 21:56:39 -07:00
Jim Meyering
b3def738f3 maint: require that commit messages be of a certain form
* bootstrap.conf (bootstrap_epilogue): Merge from coreutils, so that
a local commit hook will now help enforce consistent commit messages.
* Makefile.am (check-git-hook-script-sync): New rule, largely copied
from coreutils.
* scripts/git-hooks/commit-msg: New file, from coreutils, but
with adapted list of program names.
* scripts/git-hooks/applypatch-msg: New file, from git.
* scripts/git-hooks/pre-applypatch: Likewise.
* scripts/git-hooks/pre-commit: Likewise.
2016-08-13 21:56:16 -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
88d911dbc7 build: ignore texinfo build artifacts
* .gitignore: Ignore texinfo artifacts in doc/.
2016-08-13 21:46:49 -07:00
Jim Meyering
1b3907f976 maint: diff3: remove an unreachable statement
* src/diff3.c (main): Remove unreachable "return" after exit from main.
2016-08-13 21:44:11 -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.
v3.4
2016-08-08 10:10:51 -07:00
Jim Meyering
05476e882f gnulib: update to latest 2016-08-06 13:50:06 -07:00
Jim Meyering
91d2340886 tests: tweak built_programs definition
* tests/Makefile.am (built_programs): Adjust to work around what
may be a problem due to interaction between Solaris 10's /bin/sh
and an old version of GNU make. Reported by Dagobert Michelsen
in https https://bugs.gnu.org/24137.
2016-08-06 11:19:07 -07:00
Jim Meyering
a37c584686 gnulib: update to latest 2016-08-02 19:09:20 -07:00
Jim Meyering
38e3a1dd49 tests: skip a /proc/self-dependent test on the Hurd
* tests/brief-vs-stat-zero-kernel-lies: The Hurd's /proc/self
is not useful, so detect that and skip the test that requires it.
Reported by Assaf Gordon in https://debbugs.gnu.org/24121#29
2016-08-02 09:30:06 -07:00
Jim Meyering
df14e616b3 tests/colors: fix portability problem with touch --date
* tests/colors (epoch): Don't use GNU touch's --date=$epoch option.
Use the portable -t 197001010000.00.
Reported by Assaf Gordon in https://debbugs.gnu.org/24121#8
2016-08-01 09:23:03 -07:00
Jim Meyering
47f84d5a75 build: Solaris 9: avoid link failure due to isblank use
* bootstrap.conf (gnulib_modules): Add isblank, to avoid a link
error on Solaris 9 Sparc.  Reported by Dagobert Michelsen.
2016-08-01 08:27:48 -07:00
Jim Meyering
b43e6fed25 test: improve test infrastructure
* tests/envvar-check: New file, copied from grep, with the addition
of the EDITOR and GREP_OPTIONS envvar names.
* tests/Makefile.am (EXTRA_DIST): Add it.
(TESTS_ENVIRONMENT): Revamp, to be more like that of grep.
2016-08-01 08:27:32 -07:00