Imported Upstream version 3.8
[platform/upstream/diffutils.git] / ChangeLog
1 2021-08-01  Jim Meyering  <meyering@fb.com>
2
3         version 3.8
4         * NEWS: Record release date.
5
6         build: update gnulib to latest
7
8 2021-07-31  Jim Meyering  <meyering@fb.com>
9
10         cmp: avoid reading uninitialized memory
11         [This *is* useful, so reapply. ]
12         When comparing buffers a word at a time, cmp could read up to
13         sizeof (word) - 1 uninitialized bytes.
14         * src/cmp.c (cmp): Set not just a single guaranteed-differing
15         sentinel byte just beyond any final read byte, but also ensure
16         that any following bytes are defined, if those may be read via
17         block_compare's word-at-a-time comparison.  Reported by Bruno Haible
18         in https://lists.gnu.org/r/diffutils-devel/2021-07/msg00003.html
19
20 2021-07-28  Bruno Haible  <bruno@clisp.org>
21
22         cmp: avoid reading uninitialized memory
23         One or both of the sentinel bytes were copies of uninitialized values.
24         * src/cmp.c (cmp): Use arbitrary initialized values for the
25         sentinel bytes.
26
27 2021-07-28  Jim Meyering  <meyering@fb.com>
28
29         cmp: revert preceding change
30         It did not solve the problem. The next patch does.
31
32 2021-07-27  Jim Meyering  <meyering@fb.com>
33
34         cmp: avoid reading uninitialized memory
35         When comparing buffers a word at a time, cmp could read up to
36         sizeof (word) - 1 uninitialized bytes.
37         * src/cmp.c (cmp): Set not just a single guaranteed-differing
38         sentinel byte just beyond any final read byte, but also ensure
39         that any following bytes are defined, if those may be read via
40         block_compare's word-at-a-time comparison.  Reported by Bruno Haible
41         in https://lists.gnu.org/r/diffutils-devel/2021-07/msg00003.html
42
43 2021-07-19  Paul Eggert  <eggert@cs.ucla.edu>
44
45         build: update gnulib submodule to latest
46
47 2021-05-21  Paul Eggert  <eggert@cs.ucla.edu>
48
49         diff: better --color help
50         * src/diff.c (option_help_msgid): Reword --color help without
51         using the confusing word “default”.  Problem reported
52         by Peter Oliver (Bug#48532).
53
54 2021-05-20  Paul Eggert  <eggert@cs.ucla.edu>
55
56         doc: fix URL in HACKING
57
58 2021-03-24  Paul Eggert  <eggert@cs.ucla.edu>
59
60         diff: pacify compiler re style
61         * src/diff.c (usage): Prefer &"string"[N] to "string" + N.
62         Some compilers complain about the latter, as they worry C++
63         refugees will think it’s string concatnation.
64
65         diff3: avoid signed int overflow
66         * src/diff3.c (main): Avoid signed integer overflow in the very
67         unlikely case of more than INT_MAX incompatible options.  Instead,
68         use one bit to record the presence of each type of incompatible
69         option, and report an error if more than one bit is set.
70
71         maint: don’t bother with -Wno-return-local-addr
72         * configure.ac (WERROR_CFLAGS): Don’t bother with
73         -Wno-return-local-addr as it doesn’t seem to work.
74         Anyway, it’s no longer needed on Ubuntu 20.10.
75
76         maint: disable -Wstack-protector
77         * configure.ac (WERROR_CFLAGS): Disable -Wstack-protector, as it
78         has a false alarm with lib/vasnprintf.c on Ubuntu 20.10 and it’s
79         not worth working around.  Coreutils already disables it.
80
81         diff: plug memory leak in ifdef.c
82         Problem reported by Than (Bug#47362).
83         Fix the bug by using xmalloca instead of vararrays.
84         * bootstrap.conf (gnulib_modules): Add xmalloca; remove vararrays.
85         * configure.ac: Remove AC_C_VARARRAYS.
86         * src/ifdef.c: Include xmalloca.h instead of xalloc.h.
87         (do_printf_spec): Use xmalloca instead of an xmalloc
88         that lacks a corresponding ‘free’ if HAVE_C_VARARRAYS
89         due to a typo in 2017-05-18T05:51:31Z!meyering@fb.com.
90
91         build: update gnulib submodule to latest
92
93 2021-01-02  Paul Eggert  <eggert@cs.ucla.edu>
94
95         maint: work around GCC -Wreturn-local-addr bug
96         * configure.ac: Do not use -Wreturn-local-addr in Gnulib,
97         to suppress a false alarm in vasnprintf.c.
98
99 2021-01-01  Jim Meyering  <meyering@fb.com>
100
101         maint: update all copyright year number ranges
102         Run "make update-copyright" and then...
103         * gnulib: Update to latest with copyright year adjusted.
104         * tests/init.sh: Sync with gnulib to pick up copyright year.
105         * bootstrap: Likewise.
106
107 2020-12-05  Jim Meyering  <meyering@fb.com>
108
109         build: require autoconf-2.64
110         * configure.ac: Require 2.64, up from 2.63, to align with gnulib.
111
112 2020-03-15  Jim Meyering  <meyering@fb.com>
113
114         build: update gnulib to latest
115
116         doc: adjust formatting to make apropos (man -k) work better
117         * man/Makefile.am $(dist_man1_MANS): Adjust sed substitution
118         to also remove the space after "GNU". This avoids the single
119         leading space on each man page title line.  I'm guessing that
120         interfered with indexing/searching, causing "man -k diff3" to
121         print this: diff3 (1) - (unknown subject).
122         Reported by Dan Jacobon in http://bugs.gnu.org/39769.
123
124 2020-01-19  Jim Meyering  <meyering@fb.com>
125
126         doc: correct an ancient "At present"
127         * doc/diffutils.texi (Unified Format): Correct the now
128         seriously outdated "At present" (referring to early 1990s)
129         statement to be more of a historical note.
130         Reported by Roland Illig in http://bugs.gnu.org/39184.
131
132 2020-01-05  Jim Meyering  <meyering@fb.com>
133
134         doc: use program name, not "GNU", in the nroff/man header
135         * man/Makefile.am (dist_man1_MANS): Elide "GNU " prefix
136         from the generated prog+one-line-summary, so that help2man
137         uses the program name rather than "GNU" as the nroff "name".
138         Reported by Dan Jacobson in http://bugs.gnu.org/38574.
139
140 2020-01-01  Jim Meyering  <meyering@fb.com>
141
142         maint: update all copyright year number ranges
143         Run "make update-copyright" and then...
144         * gnulib: Update to latest with copyright year adjusted.
145         * tests/init.sh: Sync with gnulib to pick up copyright year.
146         * bootstrap: Likewise.
147
148 2019-12-29  Jim Meyering  <meyering@fb.com>
149
150         maint: avoid gnulib-tool deprecation warnings, and build failure
151         * bootstrap.conf (gnulib_modules): Use getopt-gnu, rather than
152         obsolete "getopt" module. Use nstrftime in place of strftime.
153         (avoided_gnulib_modules): Do not avoid the "lock" module. That
154         would lead to a build failure due to "glthread/lock.h not found".
155
156         maint: avoid syntax-check failure
157         * po/POTFILES.in: Add argmatch.h; remove xstrtol-error.c
158
159         maint: disable two and reenable many warning options
160         * configure.ac (GNULIB_WARN_CFLAGS): Disable -Wduplicated-branches
161         and -Wreturn-local-addr, due to a couple of false-positive warnings.
162         (WARN_CFLAGS): Reenable many warnings that now (with recent gcc)
163         provoke no false positive.
164
165         maint: avoid gnulib's lock-tests module
166         * bootstrap.conf (avoided_gnulib_modules): Also --avoid=lock-tests
167         to avoid gnulib-related build failure.
168
169 2019-12-23  Jim Meyering  <meyering@fb.com>
170
171         build: update gnulib to latest
172         * gnulib: Update submodule to latest.
173         * bootstrap: Copy from gnulib.
174         * tests/init.sh: Likewise.
175
176 2019-12-20  Jim Meyering  <meyering@fb.com>
177
178         maint: tweak bootstrap.conf
179         * bootstrap.conf (buildreq): Require at least autoconf 2.62,
180         up from 2.61, just as grep and coreutils do.
181         (bootstrap_post_import_hook): "Copy pkg-config's pkg.m4 ...",
182         copied from grep's bootstrap.conf.
183         (avoided_gnulib_modules): Pull this definition to the top.
184         Formatting.
185
186 2019-10-01  Dave Odell  <dmo2118@gmail.com>  (tiny change)
187
188         cmp: add test case for Bug#37558
189         * tests/cmp: New test case (Bug#37558).
190
191 2019-10-01  Paul Eggert  <eggert@cs.ucla.edu>
192
193         cmp: fix -l width bug
194         Problem reported by Dave Odell (Bug#37558).
195         * src/cmp.c (cmp): Treat negative ‘bytes’ as infinite, fixing a
196         bug introduced in the 2019-08-27 patch that fixed Bug#35256.
197
198 2019-08-27  Paul Eggert  <eggert@cs.ucla.edu>
199
200         diff: don’t mistreat -N in arg as a large number
201         Problem reported by alec (Bug#35256).
202         * NEWS: Mention the fix.
203         * bootstrap.conf (gnulib_modules): Use strtoimax and xstrtoimax,
204         not strtoumax and strtoumax.
205         * src/cmp.c (bytes): Now signed, with -1 representing no limit.
206         All uses changed.
207         * src/cmp.c (specify_ignore_initial, main):
208         * src/diff.c (main):
209         * src/ifdef.c (format_group):
210         * src/sdiff.c (interact):
211         Use strtoimax, not strtoumax.
212
213         build: update gnulib submodule to latest
214
215 2019-07-19  Paul Eggert  <eggert@cs.ucla.edu>
216
217         maint: ignore ‘configure’ temporaries
218         * .gitignore: Ignore confdefs*, conftest*.
219
220         maint: avoid Gnulib setlocale module
221         Problem reported for MS-Windows by Richard Gering (Bug#34376).
222         Diffutils doesn’t need any of the Gnulib fixes for setlocale.
223         * bootstrap.conf (gnulib_tool_option_extras):
224         Avoid the setlocale module.
225
226 2019-05-24  KO Myung-Hun  <komh@chollian.net>
227
228         tests: init.cfg: use $PATH_SEPARATOR not ':'
229         On OS/2, a path separator is semi-colon ';' not colon ':'.
230         * tests/init.cfg: Replace ':' with $PATH_SEPARATOR.
231
232 2019-01-20  Jim Meyering  <meyering@fb.com>
233
234         build: ensure no VLA is used
235         Cause developer builds to fail for any use of a VLA.
236         VLAs (variable length arrays) limit portability.
237         * configure.ac (nw): Remove -Wvla from the list of disabled warnings,
238         thus enabling the warning when configured with --enable-gcc-warnings.
239         (GNULIB_NO_VLA) Define, disabling use of VLAs in gnulib.  This commit
240         is functionally equivalent to coreutils' v8.30-44-gd26dece5d.
241
242         build: update gnulib to latest
243         * gnulib: Update to latest.
244         * po/POTFILES.in: Add lib/xstdopen.c.
245
246 2019-01-06  Paul Eggert  <eggert@cs.ucla.edu>
247
248         diff: use xstdopen, not stdopen
249         * bootstrap.conf (gnulib_modules):
250         * src/cmp.c, src/diff.c, src/diff3.c, src/sdiff.c (main):
251         Use xstdopen, not stdopen.
252
253         build: update gnulib submodule to latest
254
255 2019-01-05  Jim Meyering  <meyering@fb.com>
256
257         maint: convert all TABs to equivalent spaces in indentation
258         Using this file,
259
260         cat > leading-blank.exempt <<\EOF
261         (\.gitmodules|help2man|pre-commit)$
262         (?:^|\/)ChangeLog[^/]*$
263         (?:^|\/)(?:GNU)?[Mm]akefile[^/]*$
264         \.(?:am|mk)$
265         EOF
266
267         run the following command to convert all non-conforming leading white
268         space to be all spaces:
269
270         git ls-files \
271           | pcregrep -vf leading-blank.exempt \
272           | xargs pcregrep -l '^ *\t' \
273           | xargs perl -MText::Tabs -ni -le \
274             '$m=/^( *\t[ \t]*)(.*)/; print $m ? expand($1) . $2 : $_'
275
276         Since that changed old NEWS, I also ran "make update-NEWS-hash"
277         to update the old_NEWS_hash value in cfg.mk.
278
279 2019-01-05  Paul Eggert  <eggert@cs.ucla.edu>
280
281         diff: fix cmp, diff3, sdiff with stdin closed
282         * NEWS: Mention this.
283         * src/cmp.c, src/diff3.c, src/sdiff.c: Include stdopen.h.
284         (main): Call stdopen early.
285         * src/cmp.c (main): Simplify now that we need not worry about
286         stdin being closed.
287         * src/diff.c (main): Translate stdopen diagnostic.
288
289         diff: remove unportable ‘diff -N - f <&-’ feature
290         * NEWS: Mention this.
291         * bootstrap.conf (gnulib_modules): Add stdopen.
292         * doc/diffutils.texi (Comparing Directories):
293         Do not document behavior if stdin is closed.
294         * src/diff.c: Include stdopen.h.
295         (main): Call stdopen early.
296         (compare_files) [__hpux]: Remove recently-introduced
297         special case for HP-UX exec with stdin closed.
298         * tests/new-file: Remove tests of the removed feature.
299
300         build: update gnulib submodule to latest
301
302 2019-01-03  Bruno Haible  <bruno@clisp.org>
303
304         diff: recognize file descriptors closed by the parent process on HP-UX
305         * src/diff.c (compare_files): Use fcntl to distinguish a file
306         descriptor closed by the parent process from a file descriptor
307         that references /dev/null.
308
309 2019-01-01  Jim Meyering  <meyering@fb.com>
310
311         maint: update all copyright dates via "make update-copyright"
312         * gnulib: Also update submodule for its copyright updates.
313
314 2018-12-31  Jim Meyering  <meyering@fb.com>
315
316         maint: post-release administrivia
317         * NEWS: Add header line for next release.
318         * .prev-version: Record previous version.
319         * cfg.mk (old_NEWS_hash): Auto-update.
320
321         version 3.7
322         * NEWS: Record release date.
323
324         maint: distribute new file, init.cfg
325         Otherwise, strip-trailing-cr would fail on a system without valgrind.
326         * tests/Makefile.am (EXTRA_DIST): Include init.cfg.
327
328 2018-12-30  Dennis Lambe Jr  <malsyned@malsyned.net>
329
330         diff: adjust ANSI escapes for compatibility with less -R
331         GNU less can display ANSI-colored text with the -R flag, but this
332         support has some limitations. One of them is that if an escape
333         sequence starts on one line and ends on a different line, only the
334         first line will be colored in less.
335
336         As a result, when diff creates colored output with multi-line deletes
337         or adds, less will only color the first line.
338
339         This change resets ANSI color to the default at the end of
340         each line and restarts it at the beginning of the next. It patches
341         normal and context mode. Side-by-side already worked in my testing.
342         * src/context.c (print_context_label, pr_context_hunk): As above.
343         (pr_unidiff_hunk, print_context_header): Likewise.
344         * src/normal.c (print_normal_hunk): Likewise.
345         * tests/colors: Adjust existing tests to accommodate this.
346         * NEWS (Improvements): Mention it.
347         Proposed in http://bugs.gnu.org/31105
348
349 2018-12-29  Jim Meyering  <meyering@fb.com>
350
351         tests: fix colors test on systems lacking fractional timestamp support
352         * tests/colors: The .NNNNNNNNN suffix is not printed on some systems.
353         Adapt the test to accommodate those systems.
354
355         tests: strip-trailing-cr: avoid failure with ASAN
356         Valgrind cannot operate on an ASAN-compiled binary.
357         * tests/strip-trailing-cr (valgrind): Define as no-op when diff
358         was compiled with sanitizer support.
359
360 2018-12-28  Jim Meyering  <meyering@fb.com>
361
362         tests: add test for --strip-trailing-cr UMR bug
363         * tests/strip-trailing-cr: New file. Test for today's bug fix.
364         * tests/Makefile.am (TESTS): Add it.
365
366         tests: import test infrastructure from coreutils
367         * tests/init.cfg: New file, for require_valgrind_ definition (from coreutils).
368         * tests/Makefile.am (PATH): Don't set stderr_fileno_ here, since it is
369         now initialized in init.cfg.
370
371 2018-12-28  Paul Eggert  <eggert@cs.ucla.edu>
372             Jim Meyering  <jim@meyering.net>
373
374         diff: fix UMR with --strip-trailing-cr
375         Problem reported by Hongxu Chen (Bug#31935).
376         * src/io.c (prepare_text): Strip trailing CR before
377         doing the rest of the analysis.
378         * NEWS: Mention the fix.
379
380 2018-12-28  Bruno Haible  <bruno@clisp.org>
381
382         tests: colors: avoid test failure on AIX 7
383         * tests/colors: Splice the argument into the printf format string.
384
385 2018-12-27  Bruno Haible  <address@hidden>
386
387         maint: don't use an undocumented Autoconf macro
388         * configure.ac: Use AC_CONFIG_HEADERS instead of AC_CONFIG_HEADER.
389
390 2018-12-23  Jim Meyering  <meyering@fb.com>
391
392         build: avoid build failure with --enable-gcc-warnings and latest gcc
393         * src/diff.c (usage): Assert that each line length is no longer than
394         the minimum required size of 4095.  This lets newer gcc (currently
395         9.0.0 20181219) infer that it need not issue this warning:
396         diff.c:1012:19: error: '%.*s' directive output between 0 and 2147483647
397         bytes may exceed minimum required size of 4095
398         [-Werror=format-overflow=]
399         1012 |        printf ("  %.*s", msglen, msg);
400
401         build: update gnulib to latest; and bootstrap and init.sh
402
403         build: make the autoconf-2.63 requirement explicit
404         * configure.ac: AC_PREREQ: Require 2.63, not 2.59. And quote properly.
405         Autoconf-2.63 has been required for some time via gnulib.
406         This merely makes it explicit.
407
408 2018-12-20  Jim Meyering  <meyering@fb.com>
409
410         maint: use https: in gnu mirror URL prefix, not http
411         This appears in the generated release announcement message.
412         * cfg.mk (url_dir_list): Use https: prefix, not http:.
413
414 2018-07-24  Paul Eggert  <eggert@cs.ucla.edu>
415
416         cmp: fix bug in -b diagnostic
417         Problem reported by mancha (Bug#32249).
418         * src/cmp.c (count_newlines): Restore old value of sentinel.
419         * tests/cmp: Test for the bug.
420
421         build: update gnulib submodule to latest
422
423 2018-05-14  Paul Eggert  <eggert@cs.ucla.edu>
424
425         doc: prepend "GNU" to NAME in man pages
426         Requested by RMS.
427         * src/cmp.c, src/diff.c, src/diff3.c, src/sdiff.c:
428         Prepend "GNU" to first comment, so that the man page says "GNU".
429
430 2018-04-20  Paul Eggert  <eggert@cs.ucla.edu>
431
432         sdiff: port to mingw
433         Problem reported by Ross Burton (Bug#31218).
434         * src/sdiff.c (checksigs): Use ‘raise’, not ‘kill’.
435
436 2018-03-23  Paul Eggert  <eggert@cs.ucla.edu>
437
438         build: update gnulib submodule to latest
439
440 2018-01-14  Jim Meyering  <meyering@fb.com>
441
442         tests: fix quoting error in previous change
443         * tests/colors: Double-quote $PATH.
444
445 2018-01-06  Jim Meyering  <meyering@fb.com>
446
447         tests: port tests/colors to some env-munging shell
448         * tests/colors: Also set PATH="$PATH" in env invocation.
449
450         maint: update gnulib and copyright dates for 2018
451         * gnulib: Update to latest.
452         * all files: Run "make update-copyright".
453         * bootstrap: Update from gnulib.
454
455         maint: suppress gcc's new -Wcast-function-type in gnulib
456         * configure.ac (WERROR_CFLAGS): Suppress gcc's new -Wcast-function-type
457         warning in gnulib, because it would trigger on this:
458         sig-handler.h:47:12: error: cast between incompatible function types\
459           from 'void (* const)(int,  siginfo_t *, void *)' \
460           {aka 'void (* const)(int,  struct <anonymous> *, void *)'} \
461           to 'void (*)(int)' [-Werror=cast-function-type]
462         return (sa_handler_t) a->sa_sigaction;
463
464 2017-10-22  Jim Meyering  <meyering@fb.com>
465
466         tests: add expected-failing test for minor subopimality
467         In some unusual cases, diff -u prints suboptimal output.
468         * tests/large-subopt: New test script.
469         * tests/Makefile.am (TESTS): Add it.
470         (XFAIL_TESTS): Add it here, too, to record that this test is
471         currently expected to fail.
472         * tests/large-subopt.in1, tests/large-subopt.in2: Inputs derived from
473         those in http://bugs.gnu.org/28796
474
475 2017-09-23  Jim Meyering  <meyering@fb.com>
476
477         gnulib: update to latest
478
479 2017-05-21  Jim Meyering  <meyering@fb.com>
480
481         maint: make the announcement template Cc the devel- list
482         * cfg.mk (announcement_Cc_): Define.
483
484         maint: post-release administrivia
485         * NEWS: Add header line for next release.
486         * .prev-version: Record previous version.
487         * cfg.mk (old_NEWS_hash): Auto-update.
488
489         version 3.6
490         * NEWS: Record release date.
491
492 2017-05-19  Jim Meyering  <meyering@fb.com>
493
494         gnulib: update to latest
495
496 2017-05-18  Jim Meyering  <meyering@fb.com>
497
498         maint: update to work with GCC7's -Werror=implicit-fallthrough=
499         * src/system.h (FALLTHROUGH): Define.
500         Use new FALLTHROUGH macro in place of comments
501         * src/cmp.c: FIXME
502         * src/diff3.c: FIXME
503         * src/ifdef.c: FIXME
504         * src/sdiff.c: FIXME
505         * src/side.c: FIXME
506         * src/util.c: FIXME
507
508         gnulib: update to latest
509
510 2017-05-09  Jim Meyering  <meyering@fb.com>
511
512         tests: new-file: closed-stdin: also ensure stdout was empty
513         * tests/new-file: Also require that "out" be empty.
514
515 2017-05-06  Jim Meyering  <meyering@fb.com>
516
517         maint: stop using @acronym{...} in texinfo sources
518         * doc/diffutils.texi: Remove all uses of @acronym{...},
519         per recommendation by Karl Berry.
520         * cfg.mk (local-checks-to-skip): Remove exemption, enabling
521         the @acronym{-prohibiting syntax-check rule.
522
523 2017-05-05  Paul Eggert  <eggert@cs.ucla.edu>
524
525         cmp: improve EOF diagnostic
526         This improves on yesterday's change, following up on a
527         remark by Jim Meyering (Bug#22816#21).
528         * doc/diffutils.texi (Invoking cmp, cmp Options): Follow POSIX more
529         closely in the documentation of the information appended to the EOF
530         diagnostic.
531         * src/cmp.c (cmp): Be more specific about the shorter file's length
532         and fix some off-by-1 issues in reporting line counts.
533         * tests/cmp: Adjust to match new behavior.
534         Don't assume internal details about stdio buffering.
535
536 2017-05-04  Benno Schulenberg  <bensberg@justemail.net>
537
538         diff: describe each --help option with a single string
539         * src/diff.c: To ease translating, fuse four description pieces
540         into two whole ones.  Also reword and rewrap one of them to fit
541         within eighty characters.
542
543 2017-05-04  Paul Eggert  <eggert@cs.ucla.edu>
544
545         cmp: report prefix length when one file is shorter
546         Requested by Dan Jacobson (Bug#22816).
547         * NEWS:
548         * doc/diffutils.texi (Invoking cmp, cmp Options): Document this.
549         * src/cmp.c (cmp): Implement it.
550         * tests/Makefile.am (TESTS): Add cmp.
551         * tests/cmp: New file.
552
553 2017-05-02  Jim Meyering  <meyering@fb.com>
554
555         tests: add test for latest fix
556         * NEWS (Bug fixes): Describe it.
557         * tests/invalid-re: New test for just-fixed bug.
558         * tests/Makefile.am (TESTS): Add it.
559
560         gnulib: update to latest
561
562 2017-04-27  Paul Eggert  <eggert@cs.ucla.edu>
563
564         diff: don't crash if regexp is invalid
565         Problem reported by Marcel Böhme in:
566         http://lists.gnu.org/archive/html/bug-diffutils/2017-04/msg00002.html
567         * src/diff.c (add_regexp): Exit if re_compile_pattern fails.
568
569 2017-03-24  julama  <julama@fake-box.com>
570
571         tests: avoid false failure for unreadable /proc/cmdline
572         * tests/brief-vs-stat-zero-kernel-lies: Use "test -r" rather than
573         just "test -f".  This avoids a false test failure on a linux system
574         with grsecurity and its GRKERNSEC_PROC_USER option enabled, for which
575         /proc/cmdline is unreadable.  Reported in https://bugs.gnu.org/26155
576
577 2017-02-01  Jim Meyering  <meyering@fb.com>
578
579         tests: avoid false failure with some shells on debian, freebsd
580         * tests/colors: Move the TERM=dumb setting into the code run by
581         "returns_", since some shells do not propagate envvar setting through
582         to a use of a function like this.  That would cause this test to fail
583         because results were colorized when they should not have been.
584         Reported by Nelson Beebe.
585
586 2017-01-31  Jim Meyering  <meyering@fb.com>
587
588         maint: add "introduced in 3.4" in latest NEWS entry
589         * NEWS: Update.  Also, thanks to Nelson Beebe for reporting this.
590
591         diff: avoid UMR with ---presume-output-tty
592         * src/diff.c (main): Always define presume_output_tty.
593         Otherwise, it would be read uninitialized.
594         Introduced in v3.3-45-g17e2698
595         * NEWS (Bug fixes): Mention it.
596
597         gnulib: update to latest; and update bootstrap and init.sh
598
599         maint: change "time stamp" to "timestamp" globally
600         This avoids a new syntax-check failure.
601         * ChangeLog-2008: Perform that change.
602         * doc/diffutils.texi: Likewise.
603         * NEWS: Likewise.
604         * cfg.mk: Update the old news hash accordingly.
605
606 2017-01-01  Jim Meyering  <meyering@fb.com>
607
608         maint: update gnulib and copyright dates for 2017
609         * gnulib: Update to latest.
610         * all files: Run "make update-copyright".
611
612 2016-11-08  Jim Meyering  <meyering@fb.com>
613
614         tests: use "returns_" rather than explicit comparison with "$?"
615         * tests/colors: Use "returns_ 1" rather than testing $? = 1
616         * tests/basic: Likewise.
617         * tests/binary: Likewise.
618         * tests/filename-quoting: Likewise.
619         * tests/function-line-vs-leading-space: Likewise.
620         * tests/ignore-matching-lines: Likewise.
621         * tests/label-vs-func: Likewise.
622         * tests/new-file: Likewise.
623         * tests/no-dereference: Likewise.
624         * tests/no-newline-at-eof: Likewise.
625         * tests/stdin: Likewise.
626
627 2016-10-25  Paul Eggert  <eggert@cs.ucla.edu>
628
629         diff: fix big performance degradation in 3.4
630         * NEWS, doc/diffutils.texi (Overview): Document this.
631         * src/analyze.c (diff_2_files): Restore too_expensive heuristic,
632         but this time with a floor that is 16 times the old floor.  This
633         should fix Bug#16848, by generating good-quality output for its
634         test case, while not introducing Bug#24715, by running nearly as
635         fast as diff-3.3 for that test case.
636
637         build: update gnulib submodule to latest
638
639 2016-10-16  Jim Meyering  <meyering@fb.com>
640
641         maint: use die rather than error
642         Use "die (N, ..." rather than "error (N, ..." whenever N is a nonzero
643         constant.  That lets the compiler know that control never goes beyond
644         that point, and thus makes unnecessary the occasional following
645         "abort ();" or "break;" statement we have historically added to inform
646         static analysis tools of this aspect of "error" semantics.
647         * src/die.h: New file.
648         * src/Makefile.am (noinst_HEADERS): Add it.
649         * src/cmp.c: Use die in place of error whenever the first
650         argument is a nonzero constant.  Also remove any immediately-
651         following call to abort, and include "die.h".
652         * src/diff.c: Likewise.
653         * src/diff3.c: Likewise.
654         * src/sdiff.c: Likewise.
655         * src/util.c: Likewise.
656
657 2016-10-02  Jim Meyering  <meyering@fb.com>
658
659         gnulib: update to latest
660
661         build: avoid GCC 7's new warnings
662         * src/util.c (get_funky_string): Adjust comment so that GCC 7's
663         -Wimplicit-fallthrough recognizes it.
664         * src/diff3.c (main): Cast boolean MERGE to "int" to avoid this:
665         diff3.c:341:25: error: '~' on a boolean expression \
666         [-Werror=bool-operation]
667
668 2016-08-30  Jim Meyering  <meyering@fb.com>
669
670         gnulib: update to latest
671
672 2016-08-29  Jim Meyering  <meyering@fb.com>
673
674         gnulib: update to latest, to port to upcoming GCC 7
675         This fixes compilation errors when using gcc-7-to-be that were
676         due to missing backslashes in gnulib's intprops.h and an API
677         change in functions like __builtin_add_overflow.  This ports
678         to GCC 7's newer built-in overflow-checking functions.
679
680 2016-08-28  Paul Eggert  <eggert@cs.ucla.edu>
681
682         diff: don't assume ptrdiff_t <= long long int
683         * src/system.h (printint, pI): Port to (theoretical) platforms
684         where ptrdiff_t is wider than long long int (Bug#24311).
685
686 2016-08-27  Paul Eggert  <eggert@cs.ucla.edu>
687
688         diff: port line numbers to mingw64
689         Problem reported by Peter Rosin (Bug#24311).
690         * src/system.h (printint, pI): New typedef and macro.
691         All uses of 'long int' and "%l" in printf format replaced by
692         'printint' and "%"pI respectively.
693         * src/ifdef.c (do_printf_spec): Don't assume pI is length 1.
694
695 2016-08-20  Jim Meyering  <meyering@fb.com>
696
697         maint: post-release administrivia
698         * NEWS: Add header line for next release.
699         * .prev-version: Record previous version.
700         * cfg.mk (old_NEWS_hash): Auto-update.
701
702         version 3.5
703         * NEWS: Record release date.
704
705 2016-08-16  Jim Meyering  <meyering@fb.com>
706
707         build: arrange to build with -fno-common, when possible
708         * configure.ac (WERROR_CFLAGS): Add -fno-common, when possible.
709         This would have prevented the duplicate definition of
710         presume_output_tty that was fixed in v3.4-10-gc2dc91f.
711
712 2016-08-16  Hanno Böck  <hanno@hboeck.de>
713
714         diff: avoid duplicate definition of presume_output_tty
715         * src/util.c (presume_output_tty): Remove this definition.
716         The other is in diff.h.  Reported in https://bugs.gnu.org/24248
717
718 2016-08-14  Jim Meyering  <meyering@fb.com>
719
720         gnulib: update to latest
721
722         tests: diff3: work around missing seq on some systems
723         * tests/diff3 (seq): Provide a seq replacement function,
724         since at least AIX, SunOS 5.10, OpenBSD-5.8 lack it.
725         Reported by Assaf Gordon in https://bugs.gnu.org/24227#8
726
727 2016-08-13  Jim Meyering  <meyering@fb.com>
728
729         diff3: fix leaks, for real
730         * src/diff3.c (struct diff_block)[lint]: Add member, n2.
731         (free_diff_block, next_to_n2): New functions.
732         * tests/diff3: Add more test coverage.
733
734         maint: require that commit messages be of a certain form
735         * bootstrap.conf (bootstrap_epilogue): Merge from coreutils, so that
736         a local commit hook will now help enforce consistent commit messages.
737         * Makefile.am (check-git-hook-script-sync): New rule, largely copied
738         from coreutils.
739         * scripts/git-hooks/commit-msg: New file, from coreutils, but
740         with adapted list of program names.
741         * scripts/git-hooks/applypatch-msg: New file, from git.
742         * scripts/git-hooks/pre-applypatch: Likewise.
743         * scripts/git-hooks/pre-commit: Likewise.
744
745 2016-08-13  Bastian Beischer  <bastian.beischer@rwth-aachen.de>
746
747         diff3: fix heap use-after-free; add minimal diff3 test coverage
748         Commit v3.3-42-g3b74a90, "FIXME: src/diff3: plug a leak" added an
749         invalid use of free, leading to use-after-free in nearly any invocation
750         of diff3.  Revert that commit.
751         * NEWS (Bug fixes): Mention it.
752         * tests/diff3: New file, to add minimal test coverage.
753         * tests/Makefile.am (TESTS): Add it.
754         Reported by Bastian Beischer in http://bugs.gnu.org/24210
755
756 2016-08-13  Jim Meyering  <meyering@fb.com>
757
758         build: ignore texinfo build artifacts
759         * .gitignore: Ignore texinfo artifacts in doc/.
760
761         maint: diff3: remove an unreachable statement
762         * src/diff3.c (main): Remove unreachable "return" after exit from main.
763
764 2016-08-08  Jim Meyering  <meyering@fb.com>
765
766         diff: disable colorization for TERM=dumb
767         * src/diff.c (main): With --color or --color=auto, when TERM is
768         "dumb", disable colorization.  Suggested by Daniel Colascione.
769         * NEWS (Bug fixes): Mention it.
770         * tests/colors: Add a test that would fail without this change,
771         yet passes with it.
772
773         maint: post-release administrivia
774         * NEWS: Add header line for next release.
775         * .prev-version: Record previous version.
776         * cfg.mk (old_NEWS_hash): Auto-update.
777
778         version 3.4
779         * NEWS: Record release date.
780
781 2016-08-06  Jim Meyering  <meyering@fb.com>
782
783         gnulib: update to latest
784
785         tests: tweak built_programs definition
786         * tests/Makefile.am (built_programs): Adjust to work around what
787         may be a problem due to interaction between Solaris 10's /bin/sh
788         and an old version of GNU make. Reported by Dagobert Michelsen
789         in https https://bugs.gnu.org/24137.
790
791 2016-08-02  Jim Meyering  <meyering@fb.com>
792
793         gnulib: update to latest
794
795         tests: skip a /proc/self-dependent test on the Hurd
796         * tests/brief-vs-stat-zero-kernel-lies: The Hurd's /proc/self
797         is not useful, so detect that and skip the test that requires it.
798         Reported by Assaf Gordon in https://debbugs.gnu.org/24121#29
799
800 2016-08-01  Jim Meyering  <meyering@fb.com>
801
802         tests/colors: fix portability problem with touch --date
803         * tests/colors (epoch): Don't use GNU touch's --date=$epoch option.
804         Use the portable -t 197001010000.00.
805         Reported by Assaf Gordon in https://debbugs.gnu.org/24121#8
806
807         build: Solaris 9: avoid link failure due to isblank use
808         * bootstrap.conf (gnulib_modules): Add isblank, to avoid a link
809         error on Solaris 9 Sparc.  Reported by Dagobert Michelsen.
810
811         test: improve test infrastructure
812         * tests/envvar-check: New file, copied from grep, with the addition
813         of the EDITOR and GREP_OPTIONS envvar names.
814         * tests/Makefile.am (EXTRA_DIST): Add it.
815         (TESTS_ENVIRONMENT): Revamp, to be more like that of grep.
816
817 2016-07-31  Jim Meyering  <meyering@fb.com>
818
819         maint: remove gl/lib/reg*.c.diff; no longer needed
820         * gl/lib/regcomp.c.diff: Remove file, now that gnulib's
821         regcomp.c compiles regex.c with -Wno-unused-parameter.
822         * gl/lib/regex_internal.c.diff: This file induced a change to ensure
823         that the "Idx" type was unsigned and to remove a few "VAR < 0"
824         comparisons.  These days, it is probably fine to stay in sync with
825         gnulib/glibc's copies
826         of these files, so remove these patches, too.
827         * gl/lib/regexec.c.diff: Likewise.
828         Prompted by a report by Assaf Gordon and a suggestion from Paul Eggert.
829
830         tests: colors: fix a portability problem and work around a shell bug
831         * tests/colors (e): Fix a portability bug: use printf '\033'
832         rather than '\e' to generate the required byte sequence, since
833         for some shells (at least dash 0.5.8), the latter doesn't work.
834         Work around a shell bug whereby "local tab=$(printf '\t')"
835         would result in an empty value for "$tab": hoist each "tab"
836         definition up/out of its function to global scope.
837         Reported by Assaf Gordon in http://debbugs.gnu.org/24116#8
838
839 2016-07-23  Jim Meyering  <meyering@fb.com>
840
841         gnulib: update to latest; and tests/init.sh
842         * gnulib: Update to latest.
843         * init.sh: Update from gnulib.
844
845 2016-05-30  Jim Meyering  <meyering@fb.com>
846
847         maint: arrange for "make distcheck" to work with unreleased automake
848         * dist-check.mk (my-distcheck): Remove all .deps directories
849         before performing the recursive comparison.
850
851 2016-05-24  Glenn Morris  <rgm@gnu.org>
852
853         doc: fix a reference to emacs' emerge node
854         * doc/diffutils.texi (Interactive Merging): Correct a reference to
855         emacs' emerge node: s/emerge/Emerge/.
856         This addresses http://debbugs.gnu.org/23613
857
858 2016-04-30  Jim Meyering  <meyering@fb.com>
859
860         maint: arrange for better URLs in generated announcement message
861         * cfg.mk (url_dir_list): Define.  I had been correcting the generated
862         URLs by hand, just before the announcement.  This is better.
863
864 2016-03-15  Jim Meyering  <meyering@fb.com>
865
866         maint: don't ignore gitlog-to-changelog failure
867         * Makefile.am (gen-ChangeLog): Don't ignore failure of
868         gitlog-to-changelog. This syncs to coreutils' copy of this rule.
869
870 2016-03-06  Giuseppe Scrivano  <gscrivano@gnu.org>
871
872         diff: --color: fix an infinite recursion bug
873         * src/diff.h (presume_output_tty): New extern variable.
874         * src/diff.c (PRESUME_OUTPUT_TTY_OPTION): New enum.
875         (group_format_option): Add '-presume-output-tty'.
876         (main): Handle PRESUME_OUTPUT_TTY_OPTION.
877         * src/util.c: New variable `presume_output_tty'.
878         (check_color_output): Handle presume_output_tty.
879         (set_color_context): Call process_signals only when color_context is
880         not RESET_CONTEXT.
881         * tests/colors: Check that diff doesn't crash when interrupted
882         in the middle of a color sequence.
883
884         Reported by Gisle Vanem in http://debbugs.gnu.org/22067
885
886 2016-01-31  Jim Meyering  <meyering@fb.com>
887
888         maint: update prereq version of gettext
889         * configure.ac: Increase designated gettext version to 0.19.2
890         * bootstrap.conf (buildreq): Likewise.
891         Remove now-unnecessary code to remove gettext-provided files.
892
893         gnulib: update to latest
894
895 2016-01-01  Jim Meyering  <meyering@fb.com>
896
897         FIXME: src/diff3: plug a leak
898
899 2016-01-01  Jim Meyering  <meyering@fb.com>
900
901         maint: update copyright year, bootstrap, init.sh
902         Run "make update-copyright" and then...
903
904         * gnulib: Update to latest.
905         * tests/init.sh: Update from gnulib.
906         * bootstrap: Likewise.
907
908 2015-12-06  Jim Meyering  <meyering@fb.com>
909
910         diff --brief no longer mistakenly reports diff. with 0-sized /proc/ files
911         Normally, it is safe to assume two regular files are different when
912         their st_size values are different.  However, that assumption may
913         be invalid if either value is zero, as happens with files on Linux
914         /proc and /sys file systems. Since skipping this optimization will
915         usually cost very little (one read syscall, to read zero bytes),
916         it is fine to accommodate those unusual files.
917         * src/analyze.c (diff_2_files): Do not assume regular files differ
918         just because their st_size values differ when one or more is 0.
919         * src/diff.c (compare_files): Likewise.
920         * tests/brief-vs-proc-stat-zero: New test.
921         * tests/Makefile.am: Add it.
922         * NEWS (Bug fixes): Describe it.
923         Reported by Stephan Müller in http://debbugs.gnu.org/21942
924
925         tests: arrange to print any skipped-test explanation to tty, too
926         I noticed that when a test was skipped, the reason was not printed.
927         This fixes it.  In coreutils, this variable is set in init.cfg,
928         but there is no point in putting the definition so far from the
929         code that chooses the file descriptor number in tests/Makefile.am.
930         * tests/Makefile.am (TESTS_ENVIRONMENT) [stderr_fileno_]: Define
931         here (to 9), right next to the companion "9>&2".
932
933 2015-11-29  Jim Meyering  <meyering@fb.com>
934
935         build: add gperf to the list of required programs
936         * bootstrap.conf (buildreq): Add gperf to the list.
937         Reported by Stephan Müller in http://debbugs.gnu.org/21945
938
939 2015-11-29  Giuseppe Scrivano  <gscrivano@gnu.org>
940
941         tests: Add tests for --color and --palette
942         * tests/colors: New file.
943         * tests/Makefile.am (TESTS): Add colors.
944
945         doc: mention --color and --palette in NEWS
946
947         diff: add --palette
948         * bootstrap (gnulib_modules): Add 'argmatch'.
949         * doc/diffutils.texi: Add documentation for --palette
950         * src/diff.h (set_color_palette): New prototype.
951         * src/diff.c (set_color_palette): New function.
952         (color_palette): New variable.
953         * src/utils.c: Include "argmatch.h".
954         (struct bin_str): New struct.
955         (struct color_ext_type): New struct.
956         (color_indicator): New array.
957         (indicator_name): New array.
958         (indicator_no): New enum.
959         (parse_state): New enum.
960         (put_indicator): New function.
961         (get_funky_string): New function. Copied from coreutils ls.
962         (parse_diff_color):  New function. Copied from coreutils ls
963         "parse_ls_color" function.
964         (set_color_context): Use put_indicator instead of directly
965         outputting the sequence.
966         * po/POTFILES.in: Add 'lib/argmatch.c'
967
968         diff: add support for --color
969         * doc/diffutils.texi (diff Options): Add documentation for --color.
970         Copied from coreutils ls --color.
971         * src/context.c (pr_unidiff_hunk): Set the color context.
972         (print_context_header): Likewise.
973         (pr_context_hunk): Likewise.
974         * src/diff.h (enum colors_style): New enum to record when to use colors.
975         (colors_style): New variable to memorize the argument value.
976         (set_color_context): Add function definition.
977         * src/diff.c: : Define COLOR_OPTION.
978         (specify_colors_style): New function.
979         (longopts): Add --color.
980         (main): Handle --color argument.
981         (option_help_msgid): Add usage string for --color.
982         * src/normal.c (print_normal_hunk): Set the color context.
983         * src/side.c (print_1sdiff_line): Likewise.
984         * src/util.c (print_1_line_nl): New function.
985         (print_1_line): Make it a wrapper of 'print_1_line_nl'.
986         (colors_enabled): New boolean variable.
987         (begin_output): Call check_color_output once the output file is
988         configured.
989         (output_1_line): Periodically call `process_signals'.
990         (caught_signals): New sigset_t.
991         (colors_enabled): New boolean variable.
992         (interrupt_signal): New sig_atomic_t.
993         (stop_signal_count): New sig_atomic_t.
994         (check_color_output): New function.
995         (install_signal_handlers): Likewise. Copied from coreutils ls.
996         (process_signals): Likewise.  Copied from coreutils ls.
997         (set_color_context): New function.
998         (sighandler): Likewise.  Copied from coreutils ls.
999         (stophandler): Likewise.  Copied from coreutils ls.
1000
1001 2015-09-24  Andreas Grünbacher  <agruen@gnu.org>
1002
1003         diff: Improve help text of option --label
1004         * src/diff.c (option_help_msgid): Improve help text of option --label.
1005
1006 2015-09-01  Jim Meyering  <meyering@fb.com>
1007
1008         build: correct man-page generation rule
1009         The PATH was set incorrectly, so that the diff used by
1010         help2man was the one from $PATH, rather than the just-built
1011         one.
1012         * man/Makefile.am (bin_dir): New variable, to...
1013         (dist_man1_MANS): ...prepend ../src to PATH, not just "..".
1014         Also, add a test to ensure that each $(bin_dir)/$$base is
1015         executable, so this doesn't happen again.
1016         In http://debbugs.gnu.org/21023, Rodrigo Valiña
1017         Gutiérrez reported that diff.1 from the diffutils-3.3 tarball
1018         contained no description of the then-new --no-dereference option.
1019
1020 2015-07-10  Jim Meyering  <meyering@fb.com>
1021
1022         doc: --no-dereference: improve wording/description
1023         * doc/diffutils.texi (Comparing Directories): Correct grammar.
1024         (diff Options) [--no-dereference]: Say a little more.
1025
1026 2015-01-01  Jim Meyering  <meyering@fb.com>
1027
1028         maint: update copyright year ranges to include 2015; update gnulib
1029
1030 2014-12-12  KO Myung-Hun  <komh@chollian.net>
1031
1032         diff: skip test if seek is not possible on OS/2 kLIBC
1033         This fixes the problem that 'diff - file' and 'cat file | diff - file'
1034         fail due to a seek failure with a message 'diff.exe: -: Invalid seek',
1035         because seek does not work on stdin and a pipe on OS/2 kLIBC.
1036
1037         * src/io.c (sip): Set skip_test to true if seek is not possible on
1038         OS/2 kLIBC.
1039
1040 2014-12-09  Jim Meyering  <meyering@fb.com>
1041
1042         gnulib: update to latest
1043
1044 2014-12-09  KO Myung-Hun  <komh78@gmail.com>
1045
1046         build: double-quote use of $PATH
1047         * man/Makefile.am (dist_man1_MANS): On OS/2, PATH_SEPARATOR is ';',
1048         but unquoted, that is interpreted as the shell's statement
1049         terminator.  Quote it.
1050
1051 2014-10-27  Paul Eggert  <eggert@cs.ucla.edu>
1052
1053         diff: fix integer overflow problem with --tabsize
1054         Reported by Tobias Stoeckmann in: http://bugs.gnu.org/18857
1055         * src/diff.c (main): Don't overflow if INTMAX_MAX / 2 < tabsize.
1056         * tests/bignum: New file, to test for this bug.
1057         * tests/Makefile.am (TESTS): Add it.
1058
1059 2014-09-03  Paul Eggert  <eggert@cs.ucla.edu>
1060
1061         doc: mention diff -B fix in NEWS
1062
1063         diff: fix bug with diff -B and incomplete lines
1064         Reported by Navin Kabra via Eric Blake in:
1065         http://bugs.gnu.org/18402
1066         * src/util.c (analyze_hunk): Don't mishandle incomplete
1067         lines at end of file.
1068         * tests/no-newline-at-eof: Test for the bug.
1069
1070         diff: fix performance bug with prefix computation
1071         * src/io.c (find_identical_ends): Fix performance bug:
1072         the test for when the prefix was needed messed up by
1073         the 2002-02-28 integer-overflow fixes, causing performance to be
1074         worse than it needed to be.
1075
1076 2014-08-23  Jim Meyering  <meyering@fb.com>
1077
1078         gnulib: update to latest, as well as bootstrap
1079
1080         maint: update copyright year range in texinfo documentation
1081         * doc/diffutils.texi: Update copyright.
1082
1083 2014-04-15  Jim Meyering  <meyering@fb.com>
1084
1085         maint: update bug-reporting address
1086         * README: Change bug-gnu-utils@... to bug-diffutils@gnu.org.
1087         * doc/diffutils.texi: Likewise.
1088         Reported by Jamie Landeg Jones.
1089
1090 2014-03-26  Paul Eggert  <eggert@penguin.cs.ucla.edu>
1091
1092         diff: fix two "..." typos in --help output
1093         * src/diff.c (option_help_msgid): Remove two "..." typos (Bug#17102).
1094
1095 2014-03-25  Paul Eggert  <eggert@cs.ucla.edu>
1096
1097         doc: improve documentation about reading and stdin
1098         See Bug#17075.
1099         * doc/diffutils.texi (Comparison): Say that files need not be read.
1100         (Invoking diff): Remove confusing remark about 'diff - -'.
1101         It's not that useful, and it's not portable anyway.
1102
1103 2014-02-24  Paul Eggert  <eggert@cs.ucla.edu>
1104
1105         diff, sdiff: minor integer overflow fixes
1106         * src/context.c (find_hunk):
1107         Simplify, now that 2 * context + 1 cannot overflow.
1108         * src/diff.c (main):
1109         * src/sdiff.c (interact):
1110         Don't rely on undefined behavior on signed integer overflow.
1111         * src/diff.c (main): Don't let contexts exceed CONTEXT_MAX.
1112         * src/system.h (CONTEXT_MAX): New macro.
1113
1114         diff: fix bug with -I and overlapping hunks
1115         Problem reported by Vincent Lefevre in <http://bugs.gnu.org/16864>.
1116         * src/context.c (find_hunk): Threshold is CONTEXT only if
1117         the second change is ignorable.
1118         * tests/ignore-matching-lines: New test.
1119         * tests/Makefile.am (TESTS): Add it.
1120
1121 2014-02-23  Paul Eggert  <eggert@cs.ucla.edu>
1122
1123         diff: remove TOO_EXPENSIVE heuristic
1124         Problem reported by Vincent Lefevre in <http://bugs.gnu.org/16848>.
1125         The simplest solution is to remove the TOO_EXPENSIVE heuristic
1126         that I added to GNU diff in 1993.  Although appropriate for
1127         circa-1993 hardware, these days the heuristic seems to be more
1128         trouble than it's worth.
1129         * NEWS: Document this.
1130         * doc/diffutils.texi (Overview): Modernize citations.
1131         Remove mention of TOO_EXPENSIVE heuristic.
1132         * src/analyze.c (diff_2_files): Adjust to TOO_EXPENSIVE-related
1133         API changes in gnulib's diffseq module.
1134
1135         build: update gnulib submodule to latest
1136
1137 2014-01-31  Paul Eggert  <eggert@cs.ucla.edu>
1138
1139         diff: exit with status 1, not 2, when binary files differ
1140         Problem reported by Vincent Lefevre in <http://bugs.gnu.org/16608>.
1141         * NEWS:
1142         * doc/diffutils.texi (Binary, Invoking diff): Document this.
1143         * src/analyze.c (briefly_report): Return void, not int.
1144         All uses changed.  Do not futz with exit status.  Simplify.
1145         * tests/binary: Adjust to match new behavior.
1146
1147 2013-09-26  Paul Eggert  <eggert@cs.ucla.edu>
1148
1149         build: omit -Wsuggest-attribute=pure for lib
1150         * configure.ac (WARN_CFLAGS): Omit -Wsuggest-attribute=pure
1151         when compiling the lib subdirectory.  Reported for Fedora 19
1152         by Eric Blake in <http://bugs.gnu.org/15463>.
1153
1154 2013-08-22  Paul Eggert  <eggert@cs.ucla.edu>
1155
1156         cmp, diff, sdiff: tune by using rawmemchr
1157         On my platform (AMD Phenom II X4 910e, Fedora 17 x86-64), this sped up
1158         'cmp -n 8GiB /dev/full /dev/zero' by a factor of 3.8, and
1159         'cmp -sn 8GiB /dev/full /dev/zero' by a factor of 1.8.
1160         * bootstrap.conf (gnulib_modules): Add rawmemchr.
1161         * src/cmp.c (cmp): Optimize the common case where buffers are the same,
1162         by using count_newlines rather than block_compare_and_count.
1163         (block_compare_and_count): Remove.
1164         (count_newlines): New function.
1165         * src/cmp.c (count_newlines):
1166         * src/io.c (prepare_text):
1167         * src/sdiff.c (lf_copy, lf_skip, lf_snarf):
1168         Use rawmemchr instead of memchr, for speed.
1169
1170 2013-08-12  Paul Eggert  <eggert@cs.ucla.edu>
1171
1172         cmp: tune 'cmp a b' for GCC x86
1173         Performance problem reported by David Balažic in:
1174         http://lists.gnu.org/archive/html/bug-diffutils/2013-08/msg00013.html
1175         * src/system.h (word): Make it size_t, not uintmax_t.
1176         This sped up plain cmp 90% on my tests (GCC 4.8.1, x86).
1177
1178 2013-07-06  Paul Eggert  <eggert@cs.ucla.edu>
1179
1180         build: update gnulib submodule to latest
1181
1182 2013-05-06  Stefano Lattarini  <stefano.lattarini@gmail.com>
1183
1184         build: enable 'subdir-objects' automake option
1185         The future major Automake version (2.0, ETA at least one year from now)
1186         might enable that option unconditionally, so better get prepared in due
1187         time.
1188
1189         * configure.ac (AM_INIT_AUTOMAKE): Adjust.
1190         (AM_PROG_CC_C_O): New, required by Automake up to 1.13.x when the
1191         'subdir-objects' is in use.
1192
1193 2013-04-28  Paul Eggert  <eggert@cs.ucla.edu>
1194
1195         build: update gnulib submodule to latest
1196
1197 2013-04-03  Paul Eggert  <eggert@cs.ucla.edu>
1198
1199         diff: fix bug with Asian file names
1200         Problem reported by Errembault Philippe in:
1201         http://lists.gnu.org/archive/html/bug-diffutils/2013-03/msg00012.html
1202         * NEWS: Document this.
1203         * src/dir.c (compare_names): Fall back on file_name_cmp if
1204         compare_collated returns 0, unless ignoring file name case.
1205         (diff_dirs): Don't bother with the O(N**2) stuff unless ignoring
1206         file name case.
1207         * tests/Makefile.am (TESTS): Add strcoll-0-names.
1208         * tests/strcoll-0-names: New file.
1209
1210         diff: remove unnecessary decl
1211         * src/dir.c (compare_names_for_qsort): Remove declaration.
1212         Not needed now that we assume C89.
1213
1214         diff: tune compare_names_for_qsort
1215         * src/dir.c (compare_collated): New function.
1216         (compare_names): Use it.
1217         (compare_names_for_qsort): Use it.  This is a bit more efficient
1218         as it can avoid a double invocation of file_name_cmp when
1219         file_name_cmp returns zero.
1220
1221 2013-03-30  Jim Meyering  <meyering@fb.com>
1222
1223         doc: mention new option, --no-dereference in 3.3's NEWS
1224         * NEWS (New feeatures): Update 3.3's news to mention --no-dereference.
1225         Reported by Denis Excoffier.
1226         * Makefile.am (old_NEWS_hash): Update, since this modifies old, and
1227         normally-immutable NEWS.
1228
1229 2013-03-26  Paul Eggert  <eggert@cs.ucla.edu>
1230
1231         tests: port to Solaris 10 /bin/sh
1232         * tests/Makefile.am (TESTS_ENVIRONMENT):
1233         Use "FOO=val; export FOO" rather than "export FOO=val",
1234         as the latter form doesn't work with Solaris /bin/sh.
1235         Problem found when trying to run "make check" on Solaris 10.
1236
1237 2013-03-24  Jim Meyering  <meyering@fb.com>
1238
1239         maint: post-release administrivia
1240         * NEWS: Add header line for next release.
1241         * .prev-version: Record previous version.
1242         * cfg.mk (old_NEWS_hash): Auto-update.
1243
1244         version 3.3
1245         * NEWS: Record release date.
1246
1247 2013-03-23  Paul Eggert  <eggert@cs.ucla.edu>
1248
1249         doc: fix menu typo
1250         * doc/diffutils.texi (Comparing Three Files): Fix out-of-order menu.
1251         Bug caught by Texinfo 5.0.
1252
1253         maint: update build procedure to recent gettext etc.
1254         * bootstrap.conf (gnulib_modules): Add vararrays.
1255         (needed_gnulib_files, unnecessary_gettext_files): New vars.
1256         (bootstrap_post_import_hook): New function, to implement these vars.
1257         (excluded_files): Remove; 'bootstrap' no longer supports this.
1258         Its function is now performed by unnecessary_gettext_files.
1259         (buildreq): Update automake to 1.12.2, to avoid CVE-2012-3386.
1260         * configure.ac (AM_GNU_GETTEXT_VERSION): Bump from 0.17 to 0.18.2,
1261         to lessen the probability that we'll have outlandishly old files
1262         during a build.
1263         * m4/vararrays.m4: Remove from repository, as we now use the
1264         gnulib version.
1265
1266 2013-03-21  Jim Meyering  <jim@meyering.net>
1267
1268         build: update gnulib to latest and adapt; update bootstrap, too
1269         Blindly updating to the latest from gnulib, bootstrap would
1270         fail due to failure of our local patches to apply.  Hence,
1271         these first two updates.
1272         * gl/lib/regex_internal.c.diff: Update offsets, so this patch
1273         applies to the latest from gnulib.
1274         * gl/lib/regex_internal.h.diff: Remove file.  No longer needed.
1275         * bootstrap: Update from gnulib.
1276
1277 2013-01-06  Paul Eggert  <eggert@cs.ucla.edu>
1278
1279         tests: port to hosts lacking fmt, make -C
1280         * tests/Makefile.am (built_programs): Don't assume fmt works.
1281         Don't rely on 'make -C', either.
1282
1283         maint: update .gitignore for recent gnulib
1284         * .gitignore: Add tests/*.trs and several *.h and *.sed files in lib,
1285
1286 2013-01-04  Jim Meyering  <jim@meyering.net>
1287
1288         build: update gnulib submodule to latest
1289
1290         maint: update all copyright year number ranges
1291         Run "make update-copyright".
1292
1293 2012-10-23  Eric Blake  <eblake@redhat.com>
1294
1295         build: default to --enable-gcc-warnings in a git tree
1296         Anyone building from cloned sources can be assumed to have a new
1297         enough environment, such that enabling gcc warnings by default will
1298         be useful.  Tarballs still default to no warnings, and the default
1299         can still be overridden with --disable-gcc-warnings.
1300         * configure.ac (gl_gcc_warnings): Set default based on environment.
1301
1302 2012-10-03  Paul Eggert  <eggert@cs.ucla.edu>
1303
1304         * doc/diffutils.texi (cmp Options): Document -l format better.
1305
1306 2012-09-10  Jim Meyering  <meyering@redhat.com>
1307
1308         maint: use xasprintf in place of xmalloc+sprintf
1309         * bootstrap.conf (gnulib_modules): Add gnulib's xvasprintf module.
1310         * src/util.c: Include "xvasprintf.h".
1311         (begin_output): Use xasprintf in place of xmalloc+sprintf.
1312
1313 2012-09-10  Andreas Gruenbacher  <agruen@gnu.org>
1314
1315         diff: encode file names with special characters
1316         * src/util.c (c_escape_char): New function.
1317         (c_escape): New function.
1318         (begin_output): Escape file names when needed.
1319         * src/context.c (print_context_header): New names parameter.
1320         (print_context_label): New name parameter.
1321         * src/diff.h (print_context_header): Change prototype.
1322         * tests/filename-quoting: New file.
1323         * NEWS: Document this change.
1324
1325 2012-08-30  Paul Eggert  <eggert@cs.ucla.edu>
1326
1327         diff: silence GCC warning instead of slowing down
1328         * src/dir.c (find_dir_file_pathname): Use 'IF_LINT (volatile)' to
1329         silence the gcc warning, rather than using 'volatile', as the
1330         warning appears to be bogus.
1331
1332 2012-08-28  Jim Meyering  <meyering@redhat.com>
1333
1334         diff: avoid possible longjmp-triggered misbehavior
1335         * src/dir.c (find_dir_file_pathname): gcc 4.8.0 20120825 reported
1336         that a local variable's value might be clobbered.  Declare "match"
1337         to be volatile.
1338
1339         build: update gnulib, bootstrap and init.sh to latest
1340
1341         maint: avoid new syntax-check failure due to @xref use
1342         * doc/diffutils.texi: Change several "; @xref{..." to ".  @xref{...",
1343         since @xref should start a sentence.
1344
1345 2012-05-15  Paul Eggert  <eggert@cs.ucla.edu>
1346
1347         maint: remove ms subdirectory
1348         diffutils is now designed to build with Cygwin or MinGW.
1349         The old DJGPP stuff probably doesn't work anyway.
1350         * Makefile.am (SUBDIRS): Remove ms.
1351         * NEWS: Document this.
1352         * configure.ac (AC_CONFIG_FILES): Remove ms/Makefile.
1353         * ms/Makefile.am, ms/README, ms/config.bat, ms/config.sed:
1354         * ms/config.site: Remove.
1355
1356 2012-05-14  Paul Eggert  <eggert@cs.ucla.edu>
1357
1358         maint: update bootstrap from gnulib
1359         * bootstrap: Update from gnulib.
1360
1361         main: port subcommands to mingw
1362         Problem reported by Eli Zaretskii in
1363         <http://lists.gnu.org/archive/html/bug-gnu-utils/2012-05/msg00013.html>.
1364         Approach suggested by Bruno Haible as option (4) in
1365         <http://lists.gnu.org/archive/html/bug-gnu-utils/2012-05/msg00036.html>.
1366         * bootstrap.conf (gnulib_modules): Add system-quote.
1367         * src/diff3.c, src/sdiff.c, src/util.c:
1368         Include <system-quote.h>, not <sh-quote.h>.
1369         * src/diff3.c (read_diff):
1370         * src/sdiff.c (main, edit):
1371         * src/util.c (begin_output):
1372         Use system_quote_argv, for portability to Mingw.
1373         * src/sdiff.c (NUM_SIGS, handler_index_of_SIGINT): Now enum
1374         values, not macros; this is cleaner and avoids a GCC warning if
1375         !HAVE_WORKING_VFORK.
1376         * src/util.c (begin_output) [! HAVE_WORKING_FORK]: Do not use -f,
1377         for consistency with the HAVE_WORKING_FORK code.
1378
1379         maint: update bootstrap from gnulib
1380         * bootstrap: Update from gnulib.
1381
1382         maint: m4/gnulib-cache.m4 is not under version control
1383         This is like what coreutils does, and suppresses 'git status' chatter.
1384         * .gitignore: Add /m4/gnulib-cache.m4.
1385
1386         Use binary mode when testing for binary files.
1387         This reverts the 2006-01-05 change and modernizes to the current API.
1388         Idea suggested by Eli Zaretskii in:
1389         http://lists.gnu.org/archive/html/bug-gnu-utils/2012-05/msg00066.html
1390         * src/cmp.c (main):
1391         * src/diff.c (main, compare_files):
1392         Use set_binary_mode rather than SET_BINARY.
1393         * src/diff.c (compare_files): Omit unnecessary use of O_BINARY.
1394         * src/io.c (sip): Sample unknown files in binary mode, to see
1395         whether they are binary.
1396         (read_files): Read binary files in binary mode.
1397
1398         build: update gnulib submodule to latest
1399
1400 2012-05-13  Stefano Lattarini  <stefano.lattarini@gmail.com>
1401
1402         build: omit obsolete AM_PROG_CC_STDC macro
1403         The Automake-provided macro 'AM_PROG_CC_STDC' has been superseded by
1404         the Autoconf-provided one 'AC_PROG_CC' since October 2002, and will
1405         be removed in the next major automake version.
1406         * configure.ac (AM_PROG_CC_STDC): Drop it.
1407
1408 2012-05-05  Jim Meyering  <meyering@redhat.com>
1409
1410         diff: fix a typo that was always disabling the same_special_file macro
1411         * src/system.h (same_special_file): Correct cpp guard expression:
1412         s/HAVE_ST_RDEV/HAVE_STRUCT_STAT_ST_RDEV/.  Reported by Eli Zaretskii.
1413
1414 2012-04-17  Jim Meyering  <meyering@redhat.com>
1415
1416         maint: update bootstrap from gnulib
1417         * bootstrap: Update from gnulib.
1418
1419 2012-03-07  Eric Blake  <eblake@redhat.com>
1420
1421         usage: improve wording of --ignore-matching-lines
1422         * src/diff.c (option_help_msgid): Tweak wording.
1423
1424 2012-03-04  Paul Eggert  <eggert@cs.ucla.edu>
1425
1426         doc: explain -I RE better in --help output
1427         * src/diff.c, src/sdiff.c (option_help_msgid): For -I RE,
1428         change "whose lines all match" to "all whose lines match" to avoid
1429         unintended interpretation.  Reported by Danijel Tasov in
1430         <http://bugs.debian.org/648411>.
1431
1432 2012-02-12  Paul Eggert  <eggert@cs.ucla.edu>
1433
1434         sdiff: remove dependency on sigprocmask
1435         * bootstrap.conf (gnulib_modules): Remove sigprocmask.
1436         * src/sdiff.c (temporary_file): No need to invoke sigprocmask
1437         here, since the signal handler merely sets a flag.
1438
1439 2012-02-04  Paul Eggert  <eggert@cs.ucla.edu>
1440
1441         diff: -N, --unidirectional-new-file now compare to "-" too
1442         * NEWS: Document this.
1443         * doc/diffutils.texi (Comparing Directories): Likewise.
1444         Also, document that these options work at the top level.
1445         * src/diff.c (compare_files): Treat EBADF like ENOENT, to handle
1446         the case where "-" is closed.  Allow the other file to be
1447         STDIN_FILENO, in case it's "-".
1448         * tests/Makefile.am (TESTS): Add new-file.
1449         * tests/new-file: New file.
1450
1451 2012-01-25  Paul Eggert  <eggert@cs.ucla.edu>
1452
1453         maint: quote 'like this' or "like this", not `like this'
1454         This is in response to a recent change in the GNU coding standards,
1455         which now suggest quoting 'like this' or "like this", instead of
1456         `like this' or ``like this''.
1457         * HACKING, NEWS, README, README-hacking, TODO, doc/diagmeet.note:
1458         * doc/diffutils.texi, ms/config.bat, ms/config.site:
1459         * src/analyze.c, src/cmp.c, src/context.c, src/diff.c:
1460         * src/diff.h, src/diff3.c, src/dir.c, src/ifdef.c, src/io.c:
1461         * src/sdiff.c, src/side.c, src/system.h, src/util.c:
1462         * tests/help-version:
1463         Quote 'like this' or "like this" in commentary.
1464         * cfg.mk (old_NEWS_hash): Adjust to reflect new NEWS quoting.
1465         * man/help2man: Update to 1.40.4 version, with quoting fixed as above.
1466         * po/en.po: Remove translation involving `, as it's no longer needed.
1467         * src/cmp.c (try_help, specify_ignore_initial, usage, main):
1468         * src/diff.c (main, try_help, option_help_msgid, specify_value)
1469         (compare_files):
1470         * src/diff3.c (main, try_help, option_help_msgid, usage)
1471         (read_diff):
1472         * src/dir.c (compare_names):
1473         * src/sdiff.c (try_help, usage, check_child_status, main):
1474         * src/util.c (finish_output):
1475         * tests/help-version:
1476         Quote 'like this' in output.
1477
1478         build: update gnulib submodule to latest
1479
1480 2012-01-12  Jim Meyering  <meyering@redhat.com>
1481
1482         build: accommodate newer bootstrap from gnulib
1483         * bootstrap.conf (gnulib_tool_option_extras): Add both --symlink
1484         and --makefile-name=gnulib.mk.  Also remove now-obsolete $bt/ prefix.
1485         * bootstrap: Update from gnulib.
1486         * tests/init.sh: Update from gnulib.
1487         * lib/Makefile.am: Initialize numerous variables, so that
1488         generated code in gnulib.mk may use += to append to them.
1489
1490         maint: avoid new syntax-check failure
1491         * src/diff.c (compare_files): Use STREQ, not strcmp.
1492
1493 2012-01-08  Bruno Haible  <bruno@clisp.org>
1494
1495         New option --no-dereference.
1496         * src/diff.h (no_dereference_symlinks): New variable.
1497         * src/diff.c: Include xreadlink.h.
1498         (longopts): Add --no-dereference option.
1499         (main): Accept --no-dereference option.
1500         (option_help_msgid): Mention the --no-dereference option.
1501         (compare_files): If no_dereference_symlinks is true, use lstat()
1502         instead of stat(). Compare symbolic links by comparing their values.
1503         * bootstrap.conf (gnulib_modules): Add lstat, stat, xreadlink.
1504         * doc/diffutils.texi (Comparing Directories, diff Options): Mention the
1505         --no-dereference option.
1506         * tests/no-dereference: New file.
1507         * tests/Makefile.am (TESTS): Add it.
1508
1509 2012-01-01  Jim Meyering  <meyering@redhat.com>
1510
1511         maint: update all copyright year number ranges
1512         Run "make update-copyright".
1513
1514 2011-12-14  Jim Meyering  <meyering@redhat.com>
1515
1516         build: update to latest gnulib and adapt
1517         * tests/binary: Reverse arguments to compare to avoid failure of
1518         new syntax-check rule.
1519         * configure.ac: Use -Wno-format-nonliteral.
1520         Mark functions as pure of const, per recommendations enabled by
1521         new gcc -W options.  Use _GL_ATTRIBUTE_PURE and _GL_ATTRIBUTE_CONST.
1522         * lib/cmpbuf.h (buffer_lcm, block_compare):
1523         Apply pure and/or const attributes.
1524         * src/cmp.c (block_compare): Likewise.
1525         * src/context.c (find_hunk): Likewise.
1526         * src/diff.h (lines_differ): Likewise.
1527         * src/diff3.c (skipwhite): Likewise.
1528         * src/dir.c (dir_loop): Likewise.
1529         * src/util.c (find_change, find_reverse_change): Likewise.
1530         (translate_line_number): Likewise.
1531
1532         build: stop distributing gzip'd releases;  xz is enough
1533         * configure.ac (AM_INIT_AUTOMAKE): Add no-dist-gzip.
1534
1535 2011-11-29  Jim Meyering  <meyering@redhat.com>
1536
1537         tests: use "compare exp out", not "compare out exp"
1538         Likewise, when an empty file is expected, use "compare /dev/null out",
1539         not "compare out /dev/null". I.e., specify the expected/desired contents
1540         via the first file name.  Prompted by a suggestion from Bruno Haible
1541         in http://thread.gmane.org/gmane.comp.gnu.grep.bugs/4020/focus=29154
1542
1543         Run these commands:
1544
1545           git grep -l -E 'compare [^ ]+ exp' \
1546             |xargs perl -pi -e 's/\b(compare) (\S+) (exp\S*)/$1 $3 $2/'
1547           git grep -l -E 'compare [^ ]+ /dev/null' \
1548             |xargs perl -pi -e 's,\b(compare) (\S+) (/dev/null),$1 $3 $2,'
1549
1550         But manually convert this one:
1551
1552           -compare out exp-$(echo $opt|tr ' ' _)
1553           +compare exp-$(echo $opt|tr ' ' _) out
1554
1555         and avoid an inappropriate change to cfg.mk.
1556
1557 2011-10-12  Stefano Lattarini  <stefano.lattarini@gmail.com>
1558
1559         tests: use more portable fd redirection in TESTS_ENVIRONMENT
1560         * tests/Makefile.am (TESTS_ENVIRONMENT): Redirection with `exec 9>&2'
1561         is not portable to various Korn shells, and to (at least) HP-UX 11
1562         /bin/sh.  Use a more portable idiom.
1563         See http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/22488 for
1564         lots of discussion.
1565
1566 2011-10-11  Stefano Lattarini  <stefano.lattarini@gmail.com>
1567
1568         tests: make test runner a script, not a shell function
1569         All the test scripts in the diffutils testsuite are shell scripts,
1570         so the current definition of TESTS_ENVIRONMENT, which adaptively
1571         run tests using either perl or the shell depending on their kind,
1572         is an overkill.
1573
1574         Moreover, this change is required in order for the testsuite to
1575         continue to work with the new testsuite harness that is planned
1576         to be introduced in Automake 1.12 (which, as of the writing date,
1577         is still under development and in late alpha state).
1578
1579         See also related discussion on bug-coreutils:
1580          <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8887>
1581
1582         * tests/Makefile.am (TESTS_ENVIRONMENT): Remove definition of the
1583         `shell_or_perl_' shell function, which is not required anymore.
1584         (LOG_COMPILER): New, define to `$(SHELL)'.
1585         * tests/binary: Make executable.
1586         * tests/colliding-file-names: Likewise.
1587         * tests/excess-slash: Likewise.
1588         * tests/no-newline-at-eof: Likewise.
1589
1590 2011-10-04  Claudio Bley  <claudio.bley@gmail.com>
1591
1592         portability: use SET_BINARY rather than xfreopen (NULL, ...
1593         * src/diff.c: Include binary-io.h, not xfreopen.h.
1594         (main): Use SET_BINARY (...) rather than xfreopen (NULL, X, ...),
1595         because the latter doesn't work on MinGW and crashes using MSVC.
1596         * src/cmp.c (main): Likewise.
1597
1598 2011-10-04  Jim Meyering  <meyering@redhat.com>
1599
1600         build: update gnulib submodule to latest
1601
1602 2011-09-02  Jim Meyering  <meyering@redhat.com>
1603
1604         post-release administrivia
1605         * NEWS: Add header line for next release.
1606         * .prev-version: Record previous version.
1607         * cfg.mk (old_NEWS_hash): Auto-update.
1608
1609         version 3.2
1610         * NEWS: Record release date.
1611
1612         build: update bootstrap and tests/init.sh from gnulib
1613         * bootstrap: Update from gnulib.
1614         * tests/init.sh: Likewise.
1615
1616         build: update gnulib submodule to latest
1617
1618 2011-09-01  Jim Meyering  <meyering@redhat.com>
1619
1620         doc: diffutils' texi-derived doc may now be in debian's "main" section
1621         * NEWS (Packaging): Mention the "no front/back-cover" change.
1622
1623 2011-08-14  Jim Meyering  <meyering@redhat.com>
1624
1625         maint: avoid new "make sytnax-check" failure.
1626         * src/diff.h (find_dir_file_pathname): Mark declaration with "extern"
1627         keyword, in order to placate the tight-scope syntax check.
1628
1629 2011-08-14  Paul Eggert  <eggert@cs.ucla.edu>
1630
1631         * src/io.c (find_and_hash_each_line): Refactor for brevity.
1632
1633 2011-08-14  Roland McGrath  <roland@hack.frob.com>
1634
1635         diff, sdiff: new option --ignore-trailing-space (-Z)
1636         Derived from Roland McGrath's patch (dated June 2004!) in:
1637         http://lists.gnu.org/archive/html/bug-gnu-utils/2004-07/msg00000.html
1638         * NEWS:
1639         * doc/diffutils.texi (White Space, Blank Lines)
1640         (sdiff Option Summary, diff Options, sdiff Options): Document -Z.
1641         * src/diff.h (IGNORE_TRAILING_SPACE)
1642         (IGNORE_TAB_EXPANSION_AND_TRAILING_SPACE): New constants, for -Z.
1643         * src/diff.c (shortopts, longopts, main, option_help_msgid):
1644         * src/sdiff.c (longopts, option_help_msgid, main):
1645         * src/io.c (find_and_hash_each_line):
1646         * src/util.c (lines_differ, analyze_hunk): Support -Z.
1647
1648 2011-08-13  Paul Eggert  <eggert@cs.ucla.edu>
1649
1650         * bootstrap.conf (gnulib_modules): Remove timegm.
1651         This fixes a problem noted by Andreas Schwab in:
1652         http://lists.gnu.org/archive/html/bug-diffutils/2011-08/msg00035.html
1653
1654 2011-08-13  Tim Waugh  <twaugh@redhat.com>
1655
1656         diff: --ignore-file-name-case now applies at top level too
1657         Derived from Tim Waugh's patch in:
1658         http://lists.gnu.org/archive/html/bug-diffutils/2011-08/msg00034.html
1659         * NEWS, doc/diffutils.texi (diff Options): Document this.
1660         * src/diff.c (compare_files): Implement this, by using
1661         find_dir_file_pathname.
1662         * src/diff.h (find_dir_file_pathname): New decl.
1663         * src/dir.c: Include filenamecat.h.
1664         (find_dir_file_pathname): New function.
1665
1666 2011-08-13  Paul Eggert  <eggert@cs.ucla.edu>
1667
1668         * .gitignore: Add lib/unistr, lib/unused-parameter.h.
1669
1670 2011-08-10  Jim Meyering  <meyering@redhat.com>
1671
1672         post-release administrivia
1673         * NEWS: Add header line for next release.
1674         * .prev-version: Record previous version.
1675         * cfg.mk (old_NEWS_hash): Auto-update.
1676
1677         version 3.1
1678         * NEWS: Record release date.
1679
1680         build: use largefile module and update to latest gnulib
1681         * configure.ac: Remove AC_SYS_LARGEFILE, subsumed by ...
1682         * bootstrap.conf (gnulib_modules): ...this.  Use largefile module.
1683         * gnulib: Update to latest.
1684
1685 2011-08-08  Santiago Vila  <sanvila@unex.es>
1686
1687         doc: insert comma in --help line for --ignore-space-change (-b)
1688         * src/diff.c (option_help_msgid): Insert omitted comma between
1689         "-b" and "--ignore-space-change".  (tiny change)
1690
1691 2011-08-04  Jim Meyering  <meyering@redhat.com>
1692
1693         doc: relax restriction on front-cover and back-cover texts
1694         * doc/diffutils.texi (copying): Relax restriction on front-cover
1695         and back-cover texts (just as m4 did here:
1696         http://git.savannah.gnu.org/cgit/m4.git/commit?id=ee1e92ec).
1697         Reported by Santiago Vila.  Fix suggested by Eric Blake.
1698
1699 2011-08-03  Jim Meyering  <meyering@redhat.com>
1700
1701         tests: update init.sh from gnulib
1702         * tests/init.sh: Update from gnulib.
1703
1704         build: update gnulib submodule to latest
1705
1706 2011-07-03  Jim Meyering  <meyering@redhat.com>
1707
1708         maint: remove inclusion of unused header, for "make syntax-check"
1709         * src/diff3.c: Don't include <inttostr.h>.  Not used.
1710         * src/context.c: Likewise.
1711
1712 2011-06-19  Jim Meyering  <meyering@redhat.com>
1713
1714         build: don't require perl when building from a tarball
1715         But do ensure -- in all other circumstances -- that the man/*.1
1716         files are rebuilt whenever the version number changes.
1717         * configure.ac (SRC_VERSION_C): Define.
1718         * man/Makefile.am (dist_man1_MANS): Rename from $(man1_MANS),
1719         so that we distribute those pesky man/*.1 files.
1720         (EXTRA_DIST): Reflect name change.
1721         (MAINTAINERCLEANFILES): Define this, not DISTCLEANFILES,
1722         now that these generated files are distributed.
1723         ($(dist_man1_MANS)): Depend on $(SRC_VERSION_C), so we get the
1724         full dependency when not building from a tarball.
1725
1726 2011-06-13  Jim Meyering  <meyering@redhat.com>
1727
1728         doc: do not distribute generated man/*.1 man files
1729         * man/help2man: New file.
1730         * man/Makefile.am: Use $(srcdir)/help2man.
1731         Convert $(dist_man1_MANS) to $(man1_MANS), to tell automake
1732         not to distribute the generated man/*.1 files.  Now they're
1733         generated at build-from-tarball time.
1734         ($(man1_MANS)): Depend on version.c, so that man pages are
1735         regenerated whenever the version string changes.
1736
1737         build: ccache works better without embedded version strings
1738         * src/Makefile.am: Generate version.c and version.h and put the
1739         new symbol in a tiny library to be used by each program.
1740         (LDADD): Add the new library.
1741         * src/cmp.c (main): Use Version, not PACKAGE_VERSION, so the .o
1742         file does not change with each commit-derived version increment.
1743         * src/diff.c (main): Likewise.
1744         * src/diff3.c (main): Likewise.
1745         * src/sdiff.c (main): Likewise.
1746         * src/system.h: Include "version.h".
1747         * .gitignore: Add version.[ch]
1748
1749 2011-06-12  Jim Meyering  <meyering@redhat.com>
1750
1751         doc: ensure each program has a man/*.x file: add "SEE ALSO" references
1752         * man/cmp.x: New file.
1753         * man/diff3.x: New file.
1754         * man/sdiff.x: New file.
1755         * man/diff.x: Add xrefs to the other three programs, and to patch.
1756         * man/Makefile.am (EXTRA_DIST): List new files.
1757         (cmp.1, diff3.1, sdiff.1): Depend on each .x file.
1758
1759         doc: rename diff.texi to diffutils.texi
1760         This makes the .texi basename the same as the package name,
1761         which is consistent with most other GNU packages.
1762         * doc/diffutils.texi: Rename from...
1763         * doc/diff.texi: ...removed.
1764         * doc/Makefile.am (info_TEXINFOS): Reflect name change.
1765         (diffutils_TEXINFOS): Likewise.
1766         * cfg.mk (gendocs_options_): Remove this customization.  It is no
1767         longer needed, now that the .texi name matches that of the package.
1768         * man/Makefile.am ($(dist_man1_MANS)): Remove now-unnecessary sed
1769         filter.
1770         * README: Update references to diffutils.texi etc. here, too.
1771         * .gitignore: Update here, too.
1772         Suggested by Karl Berry.
1773
1774 2011-06-08  Karl Berry  <karl@freefriends.org>
1775
1776         cmp, diff, diff3, sdiff: edit and align --help text.
1777         * cmp.c (option_help_msgid, usage),
1778         * diff.c (option_help_msgid, usage),
1779         * diff3.c (option_help_msgid, usage),
1780         * sdiff.c (option_help_msgid, usage): align descriptions in the --help
1781         output and slightly edit content.
1782
1783 2011-05-27  Paul Eggert  <eggert@cs.ucla.edu>
1784
1785         diff: don't use locales after local-specific sorting fails
1786         * src/dir.c (compare_names): Don't invoke strcasecmp if
1787         locale-specific sorting fails, because POSIX.1-2008 says strcasecmp
1788         has unspecified behavior outside the POSIX locale.  See:
1789         http://lists.gnu.org/archive/html/bug-diffutils/2011-05/msg00008.html
1790
1791         bootstrap: Avoid multithreading.
1792         * bootstrap.conf (gnulib_tool_option_extras):
1793         Add "--avoid=localename --avoid=lock", because we don't want to
1794         bring in the multithreading code that recent gnulib changes would
1795         otherwise bring in.
1796         (excluded_files): Remove m4/lock.m4; no longer needed, now that
1797         we use --avoid=lock.
1798
1799         build: update gnulib submodule to latest
1800
1801 2011-05-23  Karl Berry  <karl@gnu.org>
1802
1803         maint: update README-hacking
1804         * README-hacking: Update a la coreutils for git, etc.
1805
1806 2011-05-23  Jim Meyering  <meyering@redhat.com>
1807
1808         maint: update gnulib to latest with accompanying tight-scope tweaks
1809         * cfg.mk: Include $(srcdir)/dist-check.mk using "-include",
1810         to accommodate the new sc_tight_scope rule.
1811         (_gl_TS_extern): Define, to tell gnulib's tight_scope rule that
1812         headers here mark externs with "XTERN".
1813         * gnulib: Update to latest.
1814
1815 2011-05-18  Jim Meyering  <meyering@redhat.com>
1816
1817         maint: use gnulib's new readme-release module
1818         * bootstrap.conf (gnulib_modules): Add readme-release.
1819         (bootstrap_epilogue): Add the recommended perl one-liner.
1820         * README-release: Remove file; it is now generated from gnulib.
1821         * .gitignore: Add it.
1822
1823         build: update gnulib submodule to latest
1824
1825         maint: prepare for the tight-scope check
1826         * src/diff.h: Mark function declarations with "extern" in
1827         preparation for the tight-scope check.
1828         (ignore_white_space): Separate enum decl from declaration
1829         of this variable.
1830         * src/Makefile.am (diff_SOURCES): Move diff.h from here to ...
1831         (noinst_HEADERS): ...here.
1832         For convenience, since the tight-scope rule uses $(noinst_HEADERS).
1833
1834         maint: don't use now-removed gnulib "exit" module
1835         * bootstrap.conf (gnulib_modules): Remove "exit" module.
1836         It no longer exists.
1837
1838 2011-03-26  Jim Meyering  <meyering@redhat.com>
1839
1840         build: update gnulib submodule to latest
1841
1842         * .x-sc_space_tab: Remove file.  Instead, ...
1843         * cfg.mk (exclude_file_name_regexp--sc_space_tab): ...define this.
1844
1845         maint: fix typo in unused rule
1846         * cfg.mk (config-save): Fix typo: add leading "_" in variable name.
1847
1848 2011-03-18  Jim Meyering  <meyering@redhat.com>
1849
1850         doc: add a reference to wdiff(1) from diff.1
1851         * man/diff.x: New file, to add "SEE ALSO" reference to wdiff(1).
1852         * man/Makefile.am (diff.1): Depend on diff.x.
1853         ($(dist_man1_MANS)): Tell help2man to include diff.x.
1854         (EXTRA_DIST): Add diff.x.
1855         Suggestion from Dan Jacobson in http://bugs.debian.org/613319
1856
1857 2011-03-18  Eric Blake  <eblake@redhat.com>
1858
1859         docs: info should mention -L
1860         * doc/diff.texi (diff Options): Document -L.
1861
1862         docs: diff --help should mention -L
1863         * src/diff.c (option_help_msgid): Document -L.
1864
1865 2011-02-15  Jim Meyering  <meyering@redhat.com>
1866
1867         doc: speak of the --test (-a) option, not "the -a or --test option"
1868         Convert using this command:
1869         perl -pi -e \
1870           's/(\@option{-.}) or (\@option{--.*?}) option/$2 ($1) option/' \
1871           doc/diff.texi
1872         Then convert some more with this:
1873         perl -pi -e \
1874             's/the (\@option{-.}) or (\@option{--.*?})$/the $2 ($1)/' \
1875           doc/diff.texi
1876         Then convert more manually.
1877
1878         Suggested by Dan Jacobson
1879
1880 2011-01-24  Jim Meyering  <meyering@redhat.com>
1881
1882         maint: remove all uses of vfork: use fork instead
1883         Our use of vfork now provokes warnings from gcc-4.6.0.
1884         Also, vfork is no longer even specified by POSIX.1-2008.
1885         * src/diff3.c (read_diff): Change each use of vfork to "fork".
1886         Remove #ifdef'd code.
1887         * src/util.c (begin_output, finish_output): Likewise.
1888         * src/sdiff.c (cleanup, main, edit): Likewise.
1889         (handler_index_of_SIGPIPE): Remove now-unused definition.
1890         * src/system.h: Don't include <vfork.h>.
1891         (vfork): Remove definition.
1892         * ms/config.site: Remove reference to vfork cache variable.
1893
1894         tests: avoid newer but less-portable tail option syntax
1895         * tests/function-line-vs-leading-space: Use sed -n '3,$p' rather than
1896         tail -n+3.  Older versions of tail do not accept that newer syntax.
1897         Reported by Sudhakara Peram.
1898
1899         tests: fix an erroneous test
1900         On most systems, like-named files were compared, by luck.
1901         However, on others, different-named files would be compared
1902         since their names were being treated as equal -- but they had
1903         different content, so the test would fail.
1904         * tests/colliding-file-names: Use different sets of file names
1905         in d1 and d2 so that they cannot accidentally match.
1906         Put the same line in each test file.  This is required
1907         when files named e.g., abc and ABC are compared.
1908         This test was failing on a NixOS 86_64-darwin system.
1909
1910         build: update gnulib submodule to latest
1911
1912         tests: fix typo that silently disabled all tests
1913         * tests/Makefile.am (TESTS): Fix typo: s/jESTS/TESTS/
1914
1915 2011-01-23  Jim Meyering  <meyering@redhat.com>
1916
1917         build: update gnulib submodule to latest
1918
1919         maint: avoid new syntax-check failure
1920         * src/diff.c (specify_value): Use !STREQ(...), not strcmp(...) != 0.
1921         * src/diff3.c (main): Likewise.
1922
1923 2011-01-03  Jim Meyering  <meyering@redhat.com>
1924
1925         maint: update copyright year ranges to include 2011
1926         Run "make update-copyright", so "make syntax-check" works in 2011.
1927
1928         build: update gnulib submodule to latest
1929
1930 2010-12-16  Paul Eggert  <eggert@cs.ucla.edu>
1931
1932         bootstrap: adjust to recent gnulib changes
1933         * bootstrap.conf (excluded_files): Do not exclude m4/size_max.m4
1934         and m4/xsize.m4 when using an external gettext, since they are
1935         now needed by other gnulib modules.
1936
1937 2010-12-16  Jim Meyering  <meyering@redhat.com>
1938
1939         doc: add contributor guidelines: HACKING
1940         * HACKING: New file, copied 99% from the one in grep's repository.
1941
1942 2010-10-09  Jim Meyering  <meyering@redhat.com>
1943
1944         maint: describe policy on copyright year number ranges
1945         * README: Mention coreutils' long-standing policy on use of M-N
1946         ranges in copyright year lists.  Requested by Richard Stallman.
1947
1948 2010-09-04  Jim Meyering  <meyering@redhat.com>
1949
1950         maint: adjust init.sh use to conform
1951         * tests/help-version: Use one line: "${srcdir=.}/init.sh"; ...
1952         * tests/basic: Likewise.
1953         * tests/binary: Likewise.
1954         * tests/colliding-file-names: Likewise.
1955         * tests/excess-slash: Likewise.
1956         * tests/function-line-vs-leading-space: Likewise.
1957         * tests/help-version: Likewise.
1958         * tests/label-vs-func: Likewise.
1959         * tests/no-newline-at-eof: Likewise.
1960         * tests/stdin: Likewise.
1961
1962         maint: avoid shadowing warning
1963         * src/dir.c (diff_dirs): Rename shadowed local cmp to "c".
1964
1965 2010-09-03  Jim Meyering  <meyering@redhat.com>
1966
1967         build: use gettext-h, not gettext
1968         * bootstrap.conf (gnulib_modules): Use gettext-h, not gettext.
1969         The latter is overkill for a package that uses
1970         AM_GNU_GETTEXT([external]...
1971
1972         build: update build/test tools from gnulib
1973         * bootstrap: Update from gnulib.
1974         * tests/init.sh: Likewise.
1975
1976         build: update gnulib submodule to latest
1977
1978 2010-08-14  Jim Meyering  <meyering@redhat.com>
1979
1980         diff -r: avoid printing excess slashes in concatenated file names
1981         * bootstrap.conf (gnulib_modules): Add filenamecat.
1982         * src/diff.c: Include "filenamecat.h".
1983         (compare_files): Use file_name_concat, rather than dir_file_pathname.
1984         * src/util.c (dir_file_pathname): Remove now-unused function.
1985         * src/diff.h: Remove its declaration.
1986         * tests/excess-slash: New script to test for this.
1987         * tests/Makefile.am (TESTS): Add it.
1988         Forwarded by Santiago Vila from <bugs.debian.org/586301a>,
1989         reported by Jari Aalto.
1990
1991 2010-08-12  Paul Eggert  <eggert@cs.ucla.edu>
1992
1993         diff: avoid spurious diffs when two distinct dir entries compare equal
1994         Problem reported by Christoph Anton Mitterer in:
1995         http://lists.gnu.org/archive/html/bug-diffutils/2010-08/msg00000.html
1996
1997         * NEWS: Mention this bug fix.
1998         * src/dir.c (compare_names_for_qsort): Fall back on file_name_cmp
1999         if two distinct entries in the same directory compare equal.
2000         (diff_dirs): Prefer a file_name_cmp match when available.
2001         * tests/Makefile.am (TESTS): New test colliding-file-names.
2002         * tests/colliding-file-names: New file.
2003
2004 2010-05-09  Jim Meyering  <meyering@redhat.com>
2005
2006         build: update gnulib submodule to latest
2007
2008         build: don't define macros that gnulib provides
2009         * bootstrap.conf (gnulib_modules): Add signal, stdint.
2010         * lib/cmpbuf.c (SA_RESTART, SA_INTERRUPT): Remove definitions.
2011         (SIZE_MAX, PTRDIFF_MAX): Likewise.
2012         Include <stdint.h>.
2013         * src/system.h (WEXITSTATUS, WIFEXITED): Remove definitions.
2014         (SA_RESTART, SA_INTERRUPT): Likewise.
2015
2016         build: rely on gnulib's sigprocmask module
2017         * src/sdiff.c: Remove #if-!HAVE_SIGPROCMASK-guarded code.
2018         * bootstrap.conf (gnulib_modules): Add sigprocmask.
2019
2020 2010-05-04  Jim Meyering  <meyering@redhat.com>
2021
2022         doc: README-release: don't mention To:, Cc:, etc announcement headers,
2023         now that those are supplied automatically via gnulib's maint.mk.
2024         * README-release: sync with coreutils.
2025
2026         maint: teach web-doc-generating code how to do its job
2027         * cfg.mk (gendocs_options): Define, so that gendocs.sh knows
2028         the name of our texinfo source file.
2029         * gnulib: Update to latest, for new gnu-web-doc-update and maint.mk.
2030
2031 2010-05-03  Jim Meyering  <meyering@redhat.com>
2032
2033         doc: update release procedure
2034         * README-release: Rearrange slightly: post the announcement to
2035         Savannah first, so you can include a link to that post in the email.
2036         Sync a few details from coreutils' README-release.
2037
2038         post-release administrivia
2039         * NEWS: Add header line for next release.
2040         * .prev-version: Record previous version.
2041         * cfg.mk (old_NEWS_hash): Auto-update.
2042
2043         version 3.0
2044         * NEWS: Record release date.
2045
2046         build: update gnulib submodule to latest
2047
2048 2010-04-30  Jim Meyering  <meyering@redhat.com>
2049
2050         build: use gnulib's sys_wait module
2051         * bootstrap.conf (gnulib_modules): Use gnulib's sys_wait module,
2052         now that we assume its presence.
2053
2054         build: update gnulib submodule to latest
2055         * bootstrap: Also update from gnulib.
2056         * tests/init.sh: Likewise
2057
2058         maint: remove now-useless #if HAVE_HEADER_H guards
2059         * src/system.h: Include <sys/wait.h> unconditionally,
2060         now that gnulib guarantees its presence.
2061         * lib/cmpbuf.c: Likewise for <unistd.h> and <inttypes.h>.
2062
2063 2010-04-16  Jim Meyering  <meyering@redhat.com>
2064
2065         tests: use original no-newline-at-eof test, but with -U1, not -U2
2066         * tests/no-newline-at-eof: Revert to the smaller test, but with
2067         -U1 rather than -U2, since that actually triggers the bug.
2068
2069 2010-04-16  Paul Eggert  <eggert@cs.ucla.edu>
2070
2071         Followon improvements for the fix for Debian bug 577832.
2072         * src/io.c (find_and_hash_each_line): Omit the inserted newline in
2073         a simpler way.
2074         * tests/no-newline-at-eof: Fix the test case so that it rejects
2075         the old, buggy behavior.
2076
2077 2010-04-16  Jim Meyering  <meyering@redhat.com>
2078
2079         build: update gnulib submodule to latest
2080
2081         tests: test for the no-newline-at-EOF bug
2082         * tests/no-newline-at-eof: New file.
2083         * tests/Makefile.am (TESTS): Add it.
2084
2085 2010-04-16  Jim Meyering  <meyering@redhat.com>
2086
2087         diff: fix a regression when at least one input lacks a newline-at-EOF,
2088         and the final hunk plus context-length aligns exactly with the end
2089         of the newline-lacking file.  Diff would fail to output the required
2090         "\ No newline at end of file" line, thus rendering the output invalid.
2091         This bug appears to have been introduced by 2006-05-07
2092         commit 58d0483b, "(find_identical_ends): Fix huge performance bug...",
2093         at least to the extent that reverting that change fixes the bug.
2094         Considering the stated effect of that change and lack of metrics,
2095         reverting it is not an option, so here we take a more direct approach.
2096
2097         Given these inputs,
2098
2099             printf '\n1'>a; printf '\n0\n\n1'>b
2100
2101         and running diff like this:
2102
2103             ./diff -U1 a b
2104
2105         for input file "b", the pointer, files[1].linbuf[4][-1], to
2106         the last byte on the final line was mistakenly pointing at the
2107         sentinel newline at EOF, rather than at the preceding byte.
2108
2109           (gdb) p files[1].linbuf[4][-1]
2110           $3 = 10 '\n'
2111
2112         Thus, this test in the final print_1_line call:
2113
2114           if ((!line_flag || line_flag[0]) && limit[-1] != '\n')
2115             fprintf (out, "\n\\ %s\n", _("No newline at end of file"));
2116
2117         would fail, because limit[-1] (which is files[1].linbuf[4][-1])
2118         was mistakenly '\n', rather than the desired '1'.
2119
2120         My first thought was simply to adjust the final linbuf[line] setting,
2121         at the end of io.c's find_and_hash_each_line function function:
2122
2123                if (p == bufend)
2124         -       break;
2125         +       {
2126         +         if (current->missing_newline)
2127         +           --linbuf[line];
2128         +         break;
2129         +       }
2130
2131         But that would make diff misbehave with this input
2132         (same as above, but with a newline appended to "a"),
2133
2134             printf '\n1\n'>a; printf '\n0\n\n1'>b
2135             ./diff -U1 a b
2136
2137         due to the block (100 lines above) that is triggered in that case
2138         (but not in the both-files-missing-newline case):
2139
2140               if (p == bufend
2141                   && current->missing_newline
2142                   && ROBUST_OUTPUT_STYLE (output_style))
2143                 {
2144                   /* This line is incomplete.  If this is significant,
2145                      put the line into buckets[-1].  */
2146                   if (ignore_white_space < IGNORE_SPACE_CHANGE)
2147                     bucket = &buckets[-1];
2148
2149                   /* Omit the inserted newline when computing linbuf later.  */
2150                   p--;
2151                   bufend = suffix_begin = p;
2152                 }
2153
2154         Note how "p" is decremented and "bufend" adjusted.
2155         When that happens, we certainly don't want to decrement
2156         "bufend" yet again.
2157
2158         Since there is no other way to determine at the end whether "bufend"
2159         was already decremented, add a new variable to serve as witness.
2160
2161         * NEWS (Bug fixes): Mention it.
2162         Reported by Timo Juhani Lindfors in http://bugs.debian.org/577832.
2163         Forwarded by Santiago Vila.
2164
2165 2010-04-16  Jim Meyering  <meyering@redhat.com>
2166
2167         tests: update init.sh from gnulib
2168         * tests/init.sh: Update from gnulib.
2169
2170 2010-04-08  Jim Meyering  <meyering@redhat.com>
2171
2172         build: include cfg.mk and dist-check.mk in the distribution tarball
2173         * Makefile.am (EXTRA_DIST): Add cfg.mk and dist-check.mk.
2174
2175         maint: update to latest gnulib
2176         * cfg.mk (sc_cross_check_PATH_usage_in_tests): Remove rule,
2177         now that it's in gnulib's maint.mk.
2178         * gnulib: Update to latest.
2179
2180 2010-04-07  Jim Meyering  <meyering@redhat.com>
2181
2182         tests: make new PATH-crosschecking syntax-check tighter
2183         * cfg.mk (sc_cross_check_PATH_usage_in_tests): Use grep's -x (match
2184         entire line) option with -F.
2185
2186         tests: pull latest help-version from gzip
2187         * tests/help-version: Update from gzip.
2188         * Makefile.am (TESTS_ENVIRONMENT): Export VERSION,
2189         as required for this new help-version script.
2190
2191         tests: add syntax-check rule to verify that tests use proper PATH
2192         * cfg.mk (sc_cross_check_PATH_usage_in_tests): New rule, that is
2193         useful only in conjunction with the help-version script.
2194
2195         tests: use path_prepend_ consistently; remove unnecessary VERBOSE check
2196         * tests/basic: Likewise.
2197         * tests/binary: Likewise.
2198         * tests/function-line-vs-leading-space: Likewise.
2199         * tests/label-vs-func: Likewise.
2200         * tests/stdin: Likewise.
2201
2202 2010-04-06  Eric Blake  <eblake@redhat.com>
2203
2204         maint: ignore generated files
2205         * .gitignore: Ignore recent gnulib additions.
2206
2207         maint: update to latest bootstrap
2208         * bootstrap: Copy from gnulib/build-aux.
2209
2210 2010-04-05  Jim Meyering  <meyering@redhat.com>
2211
2212         tests: get latest init.sh from gnulib
2213         * tests/init.sh: Update from gnulib.
2214
2215         build: update gnulib submodule to latest; adapt
2216         * cfg.mk (local-checks-to-skip): Add new sc_texinfo_acronym, to skip it.
2217
2218         diff -F/-p: don't depend on locale-specific white-space definition
2219         * src/context.c: Include "c-ctype.h".
2220         Use c_isspace, not isspace.
2221
2222 2010-03-18  Jim Meyering  <meyering@redhat.com>
2223
2224         tests: exercise new behavior of -F RE
2225         * tests/function-line-vs-leading-space: New file.
2226         * tests/Makefile.am (TESTS): Add it.
2227
2228 2010-03-18  Yannick Moy  <yannick.moy@adacore.com>
2229
2230         with -F or -p, emit better function lines: no leading white space
2231         * src/diff.c (print_context_function): For languages like Ada
2232         that allow local functions and procedures, the plain context
2233         function line may start with enough blank characters that the
2234         function name does not get completely printed in the 40
2235         characters limit.  This patch solves this problem by removing
2236         these useless initial blank characters.
2237         * NEWS (Changes in behavior): Mention this change.
2238
2239 2010-03-17  Jim Meyering  <meyering@redhat.com>
2240
2241         build: don't require a specific version of help2man
2242         * bootstrap.conf (buildreq): Bootstrap can't deal with it,
2243         perhaps because the command name contains a digit.
2244
2245         build: make bootstrap ensure that help2man is available
2246         * bootstrap.conf (buildreq): Add help2man.
2247
2248 2010-02-23  Jim Meyering  <meyering@redhat.com>
2249
2250         tests: test for the "Binary files A and B differ" diagnostic
2251         * tests/binary: New script.
2252         * tests/Makefile.am (TESTS): Add it.
2253
2254         revert 2002 change that removed "Binary " from "files A and B differ"
2255         With this change, "printf '\0'|diff - /dev/null" now prints
2256         "Binary files - and /dev/null differ" once again.
2257         This reverts 2002-06-28 commit a352f0980,
2258         "(briefly_report): Don't say "Binary files differ", ...".
2259         * src/analyze.c (briefly_report): Do include the "Binary " prefix
2260         in the diagnostic, when !brief.
2261         * NEWS (Changes in behavior): Mention the diagnostic change.
2262         Reported by Andreas Hoenen in http://bugs.debian.org/570064.
2263
2264 2010-02-14  Juan Manuel Guerrero  <juan.guerrero@gmx.de>
2265
2266         avoid compilation failure on systems lacking both fork and vfork
2267         * src/sdiff.c [!HAVE_WORKING_FORK && !HAVE_WORKING_VFORK] (main):
2268         Pass the right number of arguments to shell_quote_copy.
2269         * src/util.c [!HAVE_WORKING_FORK && !HAVE_WORKING_VFORK] (begin_output):
2270         Likewise.
2271
2272 2010-02-11  Jim Meyering  <meyering@redhat.com>
2273
2274         post-release administrivia
2275         * NEWS: Add header line for next release.
2276         * .prev-version: Record previous version.
2277         * cfg.mk (old_NEWS_hash): Auto-update.
2278
2279         version 2.9
2280         * NEWS: Record release date.
2281
2282         doc: document the release procedure
2283         * README-release: New file.
2284
2285 2010-02-10  Jim Meyering  <meyering@redhat.com>
2286
2287         maint: change use of "|" to more maintainable "||" (no semantic change)
2288         * src/analyze.c (diff_2_files): Using the "||" operator happens to
2289         be equivalent to using "|" in this case.  It is also clearer and
2290         less prone to inadvertent bug introduction, in case the variable,
2291         "changes" were ever to take on a value not in {0,1}.
2292         Patch by Tim Waugh, via Mike Frysinger.
2293
2294         portability: avoid "diff - ..." failure at least on *BSD and Solaris
2295         The new "stdin" test was failing on many types of systems.
2296         * src/diff.c (compare_files): Guard use of xfreopen (NULL, "rb", ...
2297         also with O_BINARY, so as to avoid this unnecessary call on
2298         systems where it's not needed (on some it fails with "Bad address".
2299
2300 2010-02-09  Jim Meyering  <meyering@redhat.com>
2301
2302         tests: honor VERBOSE
2303         * tests/basic: Enable "set -x" if $VERBOSE.
2304         * tests/help-version: Likewise.
2305         * tests/label-vs-func: Likewise.
2306         * tests/stdin: Likewise.
2307
2308 2010-02-04  Jim Meyering  <meyering@redhat.com>
2309
2310         build: update gnulib submodule to latest
2311
2312         sync with gnulib
2313         * gl/lib/regcomp.c.diff: Adjust to apply to the latest in gnulib.
2314         * gnulib: Update submodule to latest.
2315
2316 2010-02-04  Jim Meyering  <meyering@redhat.com>
2317
2318         build: do not override gnulib-provided AM_CFLAGS options
2319         Avoid a warning from automake:
2320         lib/Makefile.am:23: AM_CFLAGS multiply defined in condition TRUE ...
2321         lib/gnulib.mk:30: ... `AM_CFLAGS' previously defined here
2322         lib/Makefile.am:18:   `lib/gnulib.mk' included from here
2323
2324         * lib/Makefile.am (AM_CFLAGS): Append $(WARN_CFLAGS) and
2325         $(WERROR_CFLAGS), i.e., use "+=", not "=".
2326         This was introduced via 2009-12-17 commit e58efa5b
2327         "build: enable warnings and -Werror.",
2328         but fortunately is not a bug, because the definition
2329         it would have overridden was always empty.
2330
2331 2010-01-17  Jim Meyering  <meyering@redhat.com>
2332
2333         maint: add to .gitignore
2334         * .gitignore: Ignore more.
2335
2336 2010-01-15  Jim Meyering  <meyering@redhat.com>
2337
2338         doc: add to TODO
2339         * TODO: Add an item, suggested by Dan Jacobson.
2340
2341 2010-01-13  Jim Meyering  <meyering@redhat.com>
2342
2343         tests: ensure that an argument of "-" is treated as standard input
2344         * tests/stdin: New test.
2345         * tests/Makefile.am (TESTS): Add it.
2346
2347 2010-01-10  Jim Meyering  <meyering@redhat.com>
2348
2349         tests: now "make distcheck" runs more tests, incl. syntax-check
2350         * cfg.mk: Include dist-check.mk, from coreutils.
2351         * Makefile.am (distcheck-hook): Define rule, to hook to...
2352         * dist-check.mk: New file.
2353
2354 2010-01-09  Jim Meyering  <meyering@redhat.com>
2355
2356         build: update gnulib to latest, for fixed syntax-check rule
2357
2358         maint: record updated NEWS hash
2359         * cfg.mk (old_NEWS_hash): Update to account for GFDL change.
2360
2361         build: update gnulib submodule to latest
2362
2363         tests: add a test of basic functionality
2364         * tests/basic: Start adding tests.
2365         * tests/Makefile.am (TESTS): Add it.
2366
2367         maint: udpate GFDL license to 1.3
2368         * doc/diff.texi: Update to use GFDL version 1.3.
2369
2370 2010-01-04  Eric Blake  <ebb9@byu.net>
2371
2372         build: allow compilation on cygwin
2373         * src/Makefile.am (cmp_LDADD): Move LIBICONV...
2374         (LDADD): ...into global flags, since all programs need it.
2375
2376 2010-01-03  Jim Meyering  <meyering@redhat.com>
2377
2378         maint: record update-copyright options for this package
2379         * cfg.mk: Next time, just run "make update-copyright".
2380
2381         tests: prepend ../src, not "." to PATH
2382         * tests/help-version: Correct PATH.
2383
2384 2010-01-01  Jim Meyering  <meyering@redhat.com>
2385
2386         maint: update all FSF copyright year lists to include 2010
2387         Use this command:
2388         git ls-files |grep -vE '^(\..*|COPYING|gnulib)$' |xargs \
2389         env UPDATE_COPYRIGHT_USE_INTERVALS=1 build-aux/update-copyright
2390
2391 2009-12-31  Jim Meyering  <meyering@redhat.com>
2392
2393         maint: newer gnulib; don't hard-code my GPG key ID
2394         * cfg.mk (gpg_key_ID): Remove definition, now that maint.mk automates it.
2395         * gnulib: Update to latest.
2396
2397         tests: exercise diff -p's function-name matching
2398         * tests/label-vs-func: New file.
2399         * tests/Makefile.am (TESTS): Add label-vs-func.
2400         Reported by Simon Arlott <simon@fire.lp0.eu>
2401         http://article.gmane.org/gmane.linux.kernel.janitors/14260
2402
2403         tests: use gnulib's init.sh
2404         * tests/Makefile.am (EXTRA_DIST): Add init.sh.
2405         Remove test-lib.sh.
2406         * tests/init.sh: New file.
2407         * tests/test-lib.sh: Remove file.
2408         * tests/help-version: Use init.sh, not test-lib.sh.
2409
2410 2009-11-28  Jim Meyering  <meyering@redhat.com>
2411
2412         maint: don't let trailing spaces in diffs perturb make syntax-check
2413         * .x-sc_space_tab: New file.
2414
2415 2009-11-22  Jim Meyering  <meyering@redhat.com>
2416
2417         build: enable warnings and -Werror.
2418         * src/Makefile.am (AM_CFLAGS): Enable warnings and -Werror.
2419         Set to this: $(WARN_CFLAGS) $(WERROR_CFLAGS)
2420         * lib/Makefile.am (AM_CFLAGS): Similarly, but use this:
2421         $(GNULIB_WARN_CFLAGS) $(WERROR_CFLAGS)
2422         * configure.ac (GNULIB_WARN_CFLAGS): Don't turn off -Wuninitialized.
2423
2424         build: avoid a warning from gnulib's sh-quote.c
2425         * gl/lib/sh-quote.c.diff: New file, to avoid a warning.
2426
2427         maint: avoid warnings via patched versions of gnulib's regex functions
2428         * gl/lib/regcomp.c.diff: New file.
2429         * gl/lib/regex_internal.c.diff: Likewise.
2430         * gl/lib/regex_internal.h.diff: Likewise.
2431         * gl/lib/regexec.c.diff: Likewise.
2432
2433         build: update gnulib submodule to latest
2434
2435 2009-11-20  Eric Blake  <ebb9@byu.net>
2436
2437         build: ignore more files
2438         * .gitignore: Add config.cache, *.exe.
2439
2440 2009-11-20  Eric Blake  <ebb9@byu.net>
2441
2442         build: fix test run on cygwin
2443         This, plus a gnulib update for xalloc-die-tests, are necessary
2444         for make check to pass on cygwin.
2445
2446         * tests/Makefile.am (built_programs): Ignore $(EXEEXT).
2447         * src/Makefile.am (paths.h): Add missing dependency.
2448
2449 2009-11-20  Jim Meyering  <meyering@redhat.com>
2450
2451         maint: remove vestiges of nanosleep
2452         * src/Makefile.am (LDADD): Remove $(LIB_NANOSLEEP), now
2453         that we no longer use the nanosleep module.
2454         Spotted by Eric Blake.
2455
2456         maint: don't pull in gnulib's nanosleep unnecessarily
2457         * bootstrap.conf (gnulib_modules): Remove nanosleep.  Not needed.
2458         Spotted by Eric Blake.
2459
2460         maint: cfg.mk: remove factored-out ftp host/dir definitions
2461         * cfg.mk (gnu_ftp_host-alpha, gnu_ftp_host-beta gnu_ftp_host-stable):
2462         (gnu_rel_host, url_dir_list): Remove definitions.  The defaults,
2463         now provided by maint.mk, are the same.
2464         * gnulib: Update for latest, including those maint.mk additions.
2465
2466         build: link with now-required libraries
2467         * src/Makefile.am (LDADD): Add gnulib-required libraries.
2468         (cmp_LDADD): Add $(LIBICONV), for cmp's use of proper_name_utf8.
2469
2470         maint: lib/xfreopen.c contains translatable strings
2471         * po/POTFILES.in: Add lib/xfreopen.c.
2472
2473         maint: remove hard-coded macro definitions provided by intprops.h
2474         * lib/cmpbuf.c: Include "intprops.h" rather than open-coding macros
2475         like TYPE_SIGNED and TYPE_MINIMUM.
2476
2477         maint: add gnulib's announce-gen module
2478         * bootstrap.conf (gnulib_modules): Add announce-gen
2479
2480         build: suppress warnings about bindtextdomain and textdomain
2481         * src/system.h (bindtextdomain, textdomain) [!ENABLE_NLS]: Define away.
2482
2483         build: use more gnulib modules
2484         * bootstrap.conf (gnulib_modules): Add mktime, nanosleep, strptime
2485         and timegm.
2486
2487         use xfreopen rather than freopen
2488         * src/cmp.c: Include "xfreopen.h".
2489         Use xfreopen in place of freopen.
2490         * src/diff.c Likewise, and...
2491         (main): Set exit_failure to EXIT_TROUBLE, rather than to 2.
2492         * src/diff3.c: Likewise.
2493         * bootstrap.conf (gnulib_modules): Add xfreopen.
2494
2495         build: enable many warnings
2496         * configure.ac: Add support for --enable-gcc-warnings.
2497         * bootstrap.conf (gnulib_modules): Add manywarnings.
2498         * Makefile.am (AM_CFLAGS): Add $(WARN_CFLAGS) $(WERROR_CFLAGS)
2499
2500         build: update gnulib submodule to latest
2501
2502         maint: add an assertion to suppress clang-detected warning
2503         The clang static analyzer reported that a NULL parent could be
2504         dereferenced.  However, that cannot happen, because for all callers,
2505         the parameter, parent, is always non-NULL at that point.
2506         * src/diff.c: Include <assert.h>.
2507         Assert that parent is not NULL.
2508
2509         maint: remove dead assignment from diff3.c
2510         * src/diff3.c (make_3way_diff): Remove dead assignment.
2511
2512 2009-11-17  Jim Meyering  <meyering@redhat.com>
2513
2514         build: update gnulib submodule to latest
2515
2516         maint: hide build commands behind $(AM_V_GEN)
2517         * src/Makefile.am (paths.h): Use $(AM_V_GEN), and split a long line.
2518         * man/Makefile.am ($(dist_man1_MANS)): Use $(AM_V_GEN) here, too.
2519
2520 2009-11-16  Jim Meyering  <meyering@redhat.com>
2521
2522         build: let automake generate better man-installation rules
2523         * man/Makefile.am (dist_man1_MANS): Rename from dist_man_MANS,
2524         to enable better automake-generated installation rules.
2525
2526         admin: ignore all of gnulib-tests
2527         * .gitignore: Add gnulib-tests
2528
2529 2009-11-16  Eric Blake  <ebb9@byu.net>
2530
2531         build: avoid link failure when libsigsegv is used
2532         * src/Makefile.am (LDADD): Link against LIBSIGSEGV.
2533
2534 2009-11-16  Jim Meyering  <meyering@redhat.com>
2535
2536         maint: define/use PROGRAM_NAME and AUTHORS; use propername module
2537         * bootstrap.conf (gnulib_modules): Add propername.
2538         * src/cmp.c (PROGRAM_NAME, AUTHORS): Define.
2539         (main): Use them in use of version_etc.
2540         * src/diff.c (PROGRAM_NAME, AUTHORS, main): Likewise.
2541         * src/diff3.c (PROGRAM_NAME, AUTHORS, main): Likewise.
2542         * src/sdiff.c (PROGRAM_NAME, AUTHORS, main): Likewise.
2543         * src/system.h: Include "propername.h".
2544
2545         maint: no longer define *_FILENO constants
2546         * src/system.h (STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO):
2547         Remove definitions.  Now guaranteed by gnulib.
2548
2549         maint: bug-diffutils@gnu.org is the new bug-reporting address
2550         * configure.ac (AC_INIT): Use bug-diffutils@..., not bug-gnu-utils
2551         as the bug-reporting address.
2552         * NEWS (Administrivia): Mention this.
2553         * src/cmp.c (usage): Remove hard-coded address.
2554         Instead, use gnulib's emit_bug_reporting_address function.
2555         * src/diff.c (usage, option_help_msgid): Likewise.
2556         * src/diff3.c (usage): Likewise.
2557         * src/sdiff.c (usage): Likewise.
2558
2559         sdiff, diff3: exec diff, not $(bindir)/diff
2560         * src/Makefile.am (paths.h): Emit a definition of DEFAULT_DIFF_PROGRAM
2561         that is simply "diff" (or whatever $(transform) would convert that to,
2562         e.g., "gdiff").  This makes it so that tests can work without first
2563         installing diff, and so that the binaries do not hard-code $(prefix).
2564         * NEWS (Changes in behavior): Mention this.
2565
2566 2009-11-14  Jim Meyering  <meyering@redhat.com>
2567
2568         tests: add the first script; hook up gnulib-tests
2569         * configure.ac (AC_CONFIG_FILES): Add tests/Makefile and
2570         gnulib-tests/Makefile.
2571         * tests/help-version: New file, from coreutils.
2572         * tests/test-lib.sh: Likewise.
2573         * tests/Makefile.am: New file, from gzip.
2574         * Makefile.am (SUBDIRS): Add tests and gnulib-tests.
2575         * tests/t-local.sh: New, empty(for now) file.
2576
2577 2009-11-13  Jim Meyering  <meyering@redhat.com>
2578
2579         build: require gettext-0.17
2580         * configure.ac: Require gettext-0.17; it was released two years ago.
2581
2582         build: correct gettext configure-time support
2583         * configure.ac: Use AM_GNU_GETTEXT([external], [need-ngettext]),
2584         rather than AM_GNU_GETTEXT([external], [need-formatstring-macros]).
2585         Reported by Martin Jacobs in
2586         http://thread.gmane.org/gmane.comp.parsers.bison.bugs/3181
2587
2588 2009-11-12  Jim Meyering  <meyering@redhat.com>
2589
2590         build: generalize autoheader check
2591         * bootstrap: Look for AC_CONFIG_HEADER as well as AC_CONFIG_HEADERS.
2592
2593 2009-11-11  Jim Meyering  <meyering@redhat.com>
2594
2595         maint: use a git submodule for gnulib
2596         * .gitmodules: New file, to track gnulib.
2597         * gnulib: New file, created by running this:
2598         git submodule add git://git.sv.gnu.org/gnulib.git gnulib
2599
2600         maint: tell git what it can ignore
2601         * .gitignore: Ignore generated files.