source: diffutils/vendor/current/ChangeLog-2008@ 530

Last change on this file since 530 was 530, checked in by Yuri Dario, 12 years ago

diffutils: initial vendor import of diffutils 3.2.0.

File size: 157.9 KB
Line 
12008-01-30 Paul Eggert <eggert@cs.ucla.edu>
2
3 * doc/diff.texi: Update Back-Cover text to reflect new GNU wording.
4
52008-01-24 Paul Eggert <eggert@cs.ucla.edu>
6
7 * src/side.c [!HAVE_MBRTOWC]: Supply defns for mbstate_t and mbrtowc.
8 Problem reported by Bruno Haible.
9
102008-01-23 Paul Eggert <eggert@cs.ucla.edu>
11
12 * src/side.c (print_half_line): Don't convert to unsigned char
13 unnecessarily.
14
15 Don't mishandle multibyte characters in side-by-side format.
16 Problem reported by Erik Karlsson in
17 <http://lists.gnu.org/archive/html/bug-gnu-utils/2008-01/msg00030.html>.
18 * bootstrap.conf (gnulib_modules): Add wcwidth.
19 * src/side.c: Include <wchar.h>.
20 (print_half_line): Compute number of bytes and print widths of
21 multibyte characters. Inspired by an alternative solution from
22 Bruno Haible in
23 <http://lists.gnu.org/archive/html/bug-gnu-utils/2008-01/msg00032.html>.
24
252007-12-04 Paul Eggert <eggert@cs.ucla.edu>
26
27 * NEWS: New diff option --suppress-blank-empty (no longer -u default).
28 * doc/diff.texi (Detailed Unified): Trailing spaces are no longer
29 omitted.
30 (Trailing Blanks): New section.
31 (diff Options) Mention new option.
32 * src/diff.h (suppress_blank_entry): New decl.
33 * src/context.c (pr_unidiff_hunk): Support --suppress-blank-empty.
34 * src/util.c (print_1_line): Likewise.
35 * src/diff.c (longopts, main, option_help_msgid): Likewise.
36 (SUPPRESS_BLANK_EMPTY_OPTION): New constant.
37
38 * configure.ac: Invoke gl_USE_SYSTEM_EXTENSIONS after gl_EARLY,
39 since gnulib now requires this order.
40
41 * bootstrap: Import from gnulib.
42
432007-08-17 Paul Eggert <eggert@cs.ucla.edu>
44
45 Break out diffseq.h into a separate file, so that gettext can use
46 this code. Idea and code from Bruno Haible.
47 * bootstrap.conf (gnulib_modules): Add diffseq.
48 * src/analyze.c (xvec, yvec, fdiag, bdiag, too_expensive, SNAKE_LIMIT):
49 (struct partition, diag, compareseq): Remove; now in diffseq.h.
50 (ELEMENT, EQUAL, OFFSET, EXTRA_CONTEXT_FIELDS, NOTE_DELETE, NOTE_INSERT):
51 (USE_HEURISTIC): New macros.
52 Include "diffseq.h".
53 (diff_2_files): Rewrite to use new diffseq.h interface.
54
55 * bootstrap: Import from gnulib.
56
572007-08-15 Paul Eggert <eggert@cs.ucla.edu>
58
59 * src/diff.c (compare_files): Use last_component rather than base_name,
60 adjusting to gnulib API change. This avoids a memory leak.
61 * src/sdiff.c (expand_name): Likewise.
62 * src/util.c (dir_file_pathname): Likewise.
63
64 * doc/diff.texi (Copying This Manual): Adjust to new fdl.texi layout.
65
662007-07-19 Paul Eggert <eggert@cs.ucla.edu>
67
68 * doc/diff.texi (White Space): Note that newline always ends a line,
69 so -w doesn't ignore newline-related changes. Problem reported by
70 David Kastrup.
71
72 * COPYING: New file.
73 * AUTHORS: Update from GPLv2 to GPLv3.
74 * Makefile.am: Likewise.
75 * NEWS: Likewise.
76 * README: Likewise.
77 * README-hacking: Likewise.
78 * bootstrap: Likewise.
79 * bootstrap.conf: Likewise.
80 * configure.ac: Likewise.
81 * exgettext: Likewise.
82 * doc/Makefile.am: Likewise.
83 * lib/Makefile.am: Likewise.
84 * lib/cmpbuf.c: Likewise.
85 * lib/cmpbuf.h: Likewise.
86 * lib/prepargs.c: Likewise.
87 * m4/vararrays.m4: Likewise.
88 * man/Makefile.am: Likewise.
89 * ms/Makefile.am: Likewise.
90 * ms/README: Likewise.
91 * ms/config.bat: Likewise.
92 * ms/config.sed: Likewise.
93 * ms/config.site: Likewise.
94 * po/POTFILES.in: Likewise.
95 * src/Makefile.am: Likewise.
96 * src/analyze.c: Likewise.
97 * src/cmp.c: Likewise.
98 * src/context.c: Likewise.
99 * src/diff.c: Likewise.
100 * src/diff.h: Likewise.
101 * src/diff3.c: Likewise.
102 * src/dir.c: Likewise.
103 * src/ed.c: Likewise.
104 * src/io.c: Likewise.
105 * src/normal.c: Likewise.
106 * src/sdiff.c: Likewise.
107 * src/system.h: Likewise.
108 * src/util.c: Likewise.
109
110 * src/ifdef.c: Fix typo: "GNU DIFF General Public License" should be
111 "GNU General Public License". Reported by Erich Guenther.
112 * src/side.c: Likewise.
113
1142007-06-18 Paul Eggert <eggert@cs.ucla.edu>
115
116 * bootstrap.conf (gnulib_modules): Add inttypes.
117 * src/context.c (print_context_label): Don't assume that time_t
118 fits in long int, since it doesn't in FreeBSD/arm. Problem
119 reported by Xin Li in
120 <http://lists.gnu.org/archive/html/bug-gnu-utils/2007-06/msg00091.html>.
121
1222007-06-06 Paul Eggert <eggert@cs.ucla.edu>
123
124 * NEWS: Mention new sdiff aliases 1 and 2 for l and r.
125 * doc/diff.texi (Merge Commands): Likewise.
126 * src/sdiff.c (give_help): Give help for them.
127 (edit): Support them.
128
1292007-04-11 Paul Eggert <eggert@cs.ucla.edu>
130
131 * doc/diff.texi (Detailed diff3 Normal): "range is a singleton" ->
132 "there is only one line", for clarity. Suggested by Jerry Peek.
133
1342007-04-04 Paul Eggert <eggert@cs.ucla.edu>
135
136 * TODO: Mention possible sdiff improvement.
137
138 * bootstrap: Sync from gnulib.
139 * src/cmp.c: Don't include exit.h; no longer needed.
140 * src/diff.c: Likewise.
141 * src/sdiff.c: Likewise.
142 * src/dir.c: Don't include strcase.h; no longer needed.
143 * README-alpha: Remove, replacing with:
144 * README-hacking: New file, taken from coreutils with some changes.
145 The rename is required by the change to 'bootstrap'.
146
1472006-11-15 Paul Eggert <eggert@cs.ucla.edu>
148
149 * src/analyze.c (build_reverse_script): Fix typo in comment.
150 Problem and fix reported by Daniel Hipschman.
151
1522006-11-14 Paul Eggert <eggert@cs.ucla.edu>
153
154 Don't assume SIGPIPE exists, and that sigblock and sigsetmask
155 exist if sigprocmask does not. Problem reported by Paul Edwards
156 for MVS 3.8.
157 * configure.ac (sigblock): Check whether this function is
158 available, if sigprocmask is not.
159 * src/sdiff.c (sigs): Omit SIGPIPE if it's not defined.
160 Put SIGINT last; all uses changed.
161 (handler_index_of_SIGPIPE): Omit if SIGPIPE is not defined.
162 (sigblock, sigsetmask) [!HAVE_SIGBLOCK]: New macros.
163 (sigprocmask): Don't dump core if O is null.
164
1652006-11-04 Paul Eggert <eggert@cs.ucla.edu>
166
167 * src/sdiff.c (sigprocmask) [! HAVE_SIGPROCMASK]: Cast 2nd arg to
168 sigset_t *, since it might be a literal 0. Problem reported by
169 Paul Edwards for MVS 3.8.
170
1712006-09-05 Paul Eggert <eggert@cs.ucla.edu>
172
173 * NEWS: diff -u no longer outputs trailing white space unless the
174 input data has it. Suggested by Jim Meyering.
175 * doc/diff.texi (Detailed Unified): Document this.
176 * src/context.c (pr_unidiff_hunk): Implement this.
177
178 Modernize bootstrap procedure to match current gnulib.
179 * bootstrap: Sync with coreutils bootstrap, except check that
180 the directory build-aux exists before trying to copy to it.
181 * bootstrap.conf: New file.
182 (gnulib_modules): Add config-h, dup2, extensions, fcntl, fdl,
183 stat-macros, unistd.
184 * configure.ac: Invoke gl_EARLY and gl_INIT rather than
185 GNULIB_AUTOCONF_SNIPPET.
186 (AC_CONFIG_HEADER): Rename config.h to lib/config.h.
187 (AC_CHECK_HEADERS_ONCE): Don't check for fcntl.h, locale.h,
188 sys/file.h, unistd.h. We now use the fcntl and unistd modules,
189 and locale.h can be assumed for any C89 compiler.
190 (DIFFUTILS_PREREQUISITES): Remove. No longer needed now that
191 we use the stdint module.
192 (AC_CHECK_FUNCS_ONCE): Remove dup2, which is no longer needed
193 now that we use the dup2 module.
194 (AM_GNU_GETTEXT): Use need-formatstring-macros, and ...
195 (AM_GNU_GETTEXT_VERSION): specify version 0.15 instead of 0.14.5,
196 to be consistent with coreutils.
197 * lib/Makefile.am (noinst_LIBRARIES):
198 (lib_SOURCES, libdiffutils_a_LIBADD):
199 (libdiffutils_a_DEPENDENCIES, BUILT_SOURCES, EXTRA_DIST):
200 (MOSTLYCLEANFILES): Remove; now computed automatically.
201 (noinst_HEADERS, libdiffutils_a_SOURCES): Just append
202 our special files now.
203 * lib/cmpbuf.c: Include config.h unconditionally, since we
204 no longer define HAVE_CONFIG_H.
205 * lib/prepargs.c: Likewise.
206 * src/Makefile.am (LDADD): Use $(LIBINTL), not @LIBINTL@.
207 (diff_LDADD): Use $(LIB_CLOCK_GETTIME), not @LIB_CLOCK_GETTIME@.
208 * src/dir.c (dir_read): Use _D_EXACT_NAMLEN, not NAMELEN.
209 * src/system.h (volatile): Remove, since we assume C89 or better.
210 Include stat-macros.h.
211 (S_IRWXU, S_IRWXG, S_IRWXO, S_IRUSR, S_IWUSR):
212 Remove, since we now use stat-macros.h.
213 (SEEK_SET, SEEK_CUR): Remove, since we assume C89 or better.
214 Include unistd.h unconditionally, since we use unistd.
215 Likewise for fcntl.h.
216 (dup2): Remove, since we now use dup2.
217 (O_RDONLY, O_RWDR, O_BINARY): Remove, since we now use
218 fcntl.
219 Include dirent.h unconditionally.
220 (NAMLEN): Remove, replacing with....
221 (_D_EXACT_NAMLEN): New macro.
222 Include inttypes.h unconditionally.
223 (PTRDIFF_MAX, SIZE_MAX, UINTMAX_MAX, strtoumax): Remove, since
224 we now use inttypes.
225 Include locale.h unconditionally.
226 (setlocale): Remove, since we now assume locale.h.
227
2282006-09-04 Jim Meyering <jim@meyering.net>
229
230 * src/context.c (print_context_function): Do not print
231 trailing white space in a context header.
232
2332006-05-09 Paul Eggert <eggert@cs.ucla.edu>
234
235 * src/cmp.c (cmp): The previous fix wasn't quite right either, as
236 it mishandled 'cmp A B >/dev/null' when A is shorter than B and
237 differs before A's end-of-file, by outputting a bogus EOF message.
238 Also, it was inefficient if A and B were large.
239
2402006-05-07 Jim Meyering <jim@meyering.net> (tiny change)
241
242 Fix bug introduced in 2006-03-09 change:
243 cmp always exits successfully, when stdout is redirected to /dev/null.
244 * src/cmp.c (cmp): When there's a difference, arrange to return nonzero
245 also when comparison_type is the new (from 2006-03-09) type_no_stdout.
246
2472006-05-07 Paul Eggert <eggert@cs.ucla.edu>
248
249 * src/context.c (pr_context_hunk, pr_unidiff_hunk):
250 Prefer fputs or fputc to fprintf, since it's a tad more efficient
251 with unlocked-IO on glibc. Long ago we avoided fputs to
252 work around an ancient SunOS bug, but that's no longer relevant.
253 * src/diff3.c (output_diff3, dotlines, undotlines):
254 (output_diff3_edscript, output_diff3_merge): Likewise.
255 This also avoids a gcc -Wformat-security warning reported
256 by Jim Meyering.
257 * src/ed.c (print_ed_hunk, print_forward_ed_hunk, print_rcs_hunk):
258 Likewise.
259 * src/normal.c (print_normal_hunk): Likewise.
260
2612006-05-06 Paul Eggert <eggert@cs.ucla.edu>
262
263 * src/io.c (find_identical_ends): Fix huge performance bug that I
264 introduced in the 2001-11-25 change: the code to remove the
265 identical suffix also looked at the trailing sentinel, which meant
266 the common suffix length was always incorrectly calculated to be
267 zero. Problem and fix reported by Daniel Hipschman. Instead of
268 his fix, revert to the pre-2001 code.
269
270 * doc/diff.texi: Switch from GFDL 1.1 to 1.2.
271
2722006-03-13 Paul Eggert <eggert@cs.ucla.edu>
273
274 * src/system.h (PARAMS, PROTOTYPES): Remove; no longer needed.
275 (IF_LINT): New macro, to pacify GCC.
276 * src/analyze.c (diag, compareseq): Use IF_LINT.
277 * src/cmp.c (cmp): Likewise.
278 * src/diff3.c (process_diff): Likewise. Also, prefer NULL to 0.
279 * src/ifdef.c (do_printf_spec, scan_char_literal): Likewise.
280 * src/sdiff.c (edit): Likewise.
281
2822006-03-09 Paul Eggert <eggert@cs.ucla.edu>
283
284 * src/cmp.c (type_no_stdout): New constant.
285 (main): Use it to avoid bug when the "EOF on foo" message is
286 generated and stdout is /dev/null.
287 Problem reported by Vincent Lefevre (Debian bug 356083).
288
2892006-01-04 Paul Eggert <eggert@cs.ucla.edu>
290
291 * README-alpha: Describe CVS access better, using the README-alpha
292 from GNU tar.
293 * AUTHORS: Simplify list by removing legalisms.
294 * THANKS: Add Larry Wall, who contributed to manual. Update email
295 addresses.
296 * Makefile.am (SUBDIRS): Remove m4. Put lib first, then other
297 source files, so documentation can rely on programs being built.
298 * bootstrap: Import changes from Bison bootstrap. Add gettext,
299 gettime, sh-quote, stat-time, verify, version-etc-fsf modules.
300 Remove posixver module. Retrieve doc/fdl.texi from gnulib.
301 Handle gettext.m4 like glibc21.m4. Don't remove po/en.po.
302 * configure.ac (AC_PREREQ): Bump to 2.59.
303 (AC_INIT): Bump version to 2.8.7-cvs.
304 (AC_CONFIG_AUX_DIR): Change from config to build-aux.
305 Prefer AC_CHECK_HEADERS_ONCE to AC_CHECK_HEADERS
306 and AC_CHECK_FUNCS_ONCE to AC_CHECK_FUNCS.
307 Remove jm_AC_TYPE_INTMAX_T, jm_AC_TYPE_UINTMAX_T,
308 AC_STRUCT_ST_MTIM_NSEC.
309 (DIFFUTILS_PREREQUISITES): New macro. Call it.
310 (REGEX_MALLOC): Remove; no longer needed.
311 (AM_GNU_GETTEXT_VERSION): Now 0.14.15.
312 (AM_GNU_GETTEXT): Call.
313 (LIB_CLOCK_GETTIME): Remove; bootstrap now does that.
314 (AC_FUNC_SETMODE_DOS): Remove.
315 (AC_CONFIG_FILES): Remove m4/Makefile.
316 * doc/diff.texi: Use @- at end of lines that should end in white space,
317 so that Emacs doesn't remove the white space.
318 (diff Options): "diff -NUM" is a pure extension to POSIX, so support
319 it unconditionally.
320 * lib/Makefile.am (noinst_HEADERS): Remove quotesys.h.
321 (lib_SOURCES): Remove quotesys.c.
322 (DISTCLEANFILES): Remove.
323 (EXTRA_DIST): Remove setmode.h, waitpid.c.
324 * lib/cmpbuf.c (block_read): Reword to avoid gcc -W warning.
325 * lib/setmode.c, lib/setmode.h: Remove.
326 * m4/setmode.m4, m4/gnu-source.m4, m4/Makefile.am.in: Remove.
327 * m4/jm-glibc-io.m4: Remove.
328 * src/cmp.c: Don't include <setmode.h>.
329 (specify_ignore_initial): Reword to avoid gcc -W warnings.
330 (main): Use freopen instead of setmode, since freopen is in POSIX.
331 * src/context.c: Revert most 2004-09-01 changes. Then:
332 (TIMESPEC_NS): Remove. All uses replaced by
333 get_stat_mtime_ns.
334 Include stat-time.h, strftime.h.
335 (nstrtime): Remove decl.
336 * src/diff.c: Revert most 2004-09-01 changes. Then:
337 Don't include <posixver.h>, <quotesys.h>, <setmode.h>.
338 Include <sh-quote.h>, <stat-time.h>, <timespec.h>.
339 All uses of quotesys replaced by sh-quote.
340 (main, compare_files):
341 Use freopen instead of setmode, since freopen is in POSIX.
342 (main): Don't complain about "diff -NUM'.
343 (main, set_mtime_to_now):
344 Adjust to stat-time.h macros when accessing nanoseconds.
345 * src/diff3.c: Include sh-quote.h rather than quotesys. All uses
346 changed.
347 * src/dir.c (dir_read): excluded_filename renamed to
348 excluded_file_name.
349 * src/io.c: Don't include <setmode.h>.
350 (sip, read_files): Remove binary file stuff, leaving a FIXME behind.
351 A DOS expert needs to look at this.
352 * src/diff.c: Include sh-quote.h rather than quotesys.h.
353 All uses changed.
354 * src/system.h: Include verify.h.
355 (verify): Remove. All uses changed to verify.h version.
356 Include <intprops.h>.
357 (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove. Now uses
358 intprops.h versions.
359 (O_BINARY): New defns, taken from coreutils.
360 * src/util.c: Include sh-quote.h rather than quotesys.h.
361 All uses changed.
362
3632004-09-01 Paul Eggert <eggert@cs.ucla.edu>
364
365 * src/diff.c (recursive, new_file, unidirectional_new_file):
366 (report_identical_files):
367 Move into struct diffopt. All uses changed.
368 (exclude_options, compare_files, specify_style, check_stdout):
369 New arg OPT. All uses changed.
370 (GDIFF_MAIN): Remove. All uses removed.
371 (function_regexp_list, ignore_regexp_list): No longer static; now
372 locals in 'main'.
373 (main): Set opt.function_regexp, opt.ignore_regexp if using regexps;
374 all other code now tests these pointers rather than inspecting fastmap
375 internals.
376 New local OPT to hold former statics; initialize it.
377 (init_regexp_list): New function, used by main.
378 (summarize_regexp_list): Now returns struct re_pattern_buffer *, and
379 assumes reglist->regexps is not NULL. All uses changed.
380
381 * src/context.c (find_function_last_search): Move into struct diffopt.
382 All uses changed.
383 (pr_context_label, pr_context_header,
384 print_context_script, find_function, find_hunk, mark_ignorable,
385 pr_context_hunk, pr_unidiff_hunk): New arg OPT. All uses changed.
386 (print_context_number_range,
387 print_unidiff_number_range): New arg OUT. All uses changed.
388
3892004-07-19 Stepan Kasal <kasal@ucw.cz>
390
391 * src/ed.c (print_ed_hunk): Optimize the case where an insert's
392 last line is a single-dot line.
393
3942004-06-30 Paul Eggert <eggert@cs.ucla.edu>
395
396 * lib/setmode.c:
397 Don't include <stdbool.h>, since setmode.h now does this.
398 Include setmode.h first, to catch interface errors.
399 Assume HAVE_SETMODE_DOS is defined.
400
401 * lib/setmode.h: Include stdbool.h.
402
4032004-04-26 Paul Eggert <eggert@cs.ucla.edu>
404
405 * bootstrap: Don't remove po/en.po.
406
4072004-04-13 Paul Eggert <eggert@twinsun.com>
408
409 * NEWS, configure.ac (AC_INIT): Version 2.8.7.
410 * configure.ac (AM_GNU_GETTEXT_VERSION): Add.
411 (XGETTEXT): Restore from pre-2004-04-12 version. This fixes
412 a bug that lost many msgids in doc/diffutils.pot.
413 * bootstrap: New file.
414 * exgettext: Don't generate a temporary file, as this runs afoul
415 of "make distcheck" which operates with read-only directories.
416 * Makefile.am (EXTRA_DIST): Add bootstrap.
417 Remove config/config.rpath as it is deduced automatically these days.
418
4192004-04-12 Paul Eggert <eggert@twinsun.com>
420
421 * NEWS, configure.ac (AC_INIT): Version 2.8.6.
422
423 * NEWS: Add news for 2.8.4, 2.8.6.
424
425 * README: Move copyright notice to end. Defer to "configure
426 --help" for special "configure" options. Suggest latest libiconv.
427 Update version numbers of Autoconf etc. to current.
428
429 * configure.ac: Quote various arguments better.
430 (AC_CONFIG_MACRO_DIR): Add call, specifying "m4".
431 (AC_CONFIG_HEADER): Replaces AM_CONFIG_HEADER.
432 (gl_USE_SYSTEM_EXTENSIONS): Replaces AC_GNU_SOURCE.
433 (AC_ISC_POSIX): Remove; nobody ports to ancient ISC any more.
434 (AC_PROG_CPP, AC_PROG_INSTALL, AC_C_INLINE,
435 AC_HEADER_STDBOOL, AC_HEADER_STDC, AM_GNU_GETTEXT, XGETTEXT,
436 AC_HEADER_STAT, AC_FUNC_VPRINTF, jm_FUNC_GLIBC_UNLOCKED_IO,
437 jm_FUNC_GNU_STRFTIME, jm_FUNC_MALLOC, jm_FUNC_REALLOC,
438 jm_PREREQ_C_STACK, jm_PREREQ_ERROR, jm_PREREQ_HARD_LOCALE,
439 jm_PREREQ_QUOTEARG, jm_PREREQ_REGEX, AC_FUNC_FNMATCH_GNU, jm_AC_DOS):
440 Remove; not needed here, as our files don't use them directly
441 or we rely on gnulib modules.
442 (AC_C_CONST): Remove; we assume C89 now.
443 (AC_CHECK_HEADERS): Remove libintl.h, limits.h, stdlib.h, string.h,
444 time.h.
445 (AC_CHECK_TYPE): Remove ptrdiff_t, ssize_t.
446 (AC_CHECK_FUNCS): Remove diraccess, strchr, strerror, tmpnam).
447 (AC_REPLACE_FUNCS): Remove memchr, mkstemp, strcasecmp.
448 (GNULIB_AUTOCONF_SNIPPET): Add call. This replaces much of
449 the above.
450 (AC_CONFIG_FILES): Remove lib/posix/Makefile.
451 (AC_CONFIG_COMMANDS): Remove.
452
453 * doc/diff.texi (dircategory): Change to "Text creation and
454 manipulation" from "GNU packages".
455 (Translations): New node.
456 (Overview): Improve quality of algorithm citations.
457 (Binary): -q doesn't exactly cause diff to assume files are binary.
458 (Normal): Place after Side by Side, since it's less important.
459 (Detailed Context, Detailed Unified, Detailed ed,
460 Detailed if-then-else, diff3 Hunks, Detailed diff3 Normal):
461 Place at end of menu.
462 (Detailed Unified): Mention that fractional timestamps are
463 omitted on hosts that don't support them.
464 Mention what happens when hunks contain just one line.
465 (Line Group Formats, Reject Names): Fix duplicate-word typos.
466 (Comparing Directories): Trailing white space and empty lines are
467 ignored in the -X file.
468 (diff Options): Add --strip-trailing-cr.
469 (Projects): gnu -> gvc@gnu.org.
470
471 * lib/Makefile.am (SUBDIRS): Remove.
472 (EXTRA_DIST, noinst_HEADERS): Remove most entries.
473 (libdiffutils_a_SOURCES): Now just lib_SOURCES.
474 (lib_SOURCES): New macro.
475 (DISTCLEANFILES, MOSTLYCLEANFILES): Set to empty now.
476 (gnulib.mk): Include: this does most of the work eliminated
477 by the above changes.
478
479 * lib/inttostr.c (inttostr): Protect i < 0 by compile-time
480 test intended to suppress compiler warnings.
481 * lib/inttostr.h: Include limits.h unilaterally.
482 (CHAR_BIT): Remove.
483 (PARAMS): Remove; all uses changed.
484 * lib/setmode.c (__attribute__): New macro.
485 (set_binary_mode): Define only if HAVE_SETMODE_DOS.
486 Otherwise define a dummy static char, as C89 requires
487 that we define something.
488 * lib/setmode.h (set_binary_mode): Return true, not 1.
489
490 * src/analyze.c, src/context.c, src/diff.c, src/io.c, src/util.c:
491 Do not include regex.h, as diff.h does this now.
492
493 * src/cmp.c: Sort includes. Include <exit.h>, <unlocked-io.h>.
494 (specify_comparison_type): Don't report an error if the comparison
495 type has already been specified the same way as this one.
496
497 * src/cmp.c (usage): Mention exit status.
498 * src/diff.c (option_help_msgid): Likewise.
499 * src/diff3.c (usage): Likewise.
500 * src/sdiff.c (usage): Likewise.
501
502 * src/cmp.c (main): Adjust to latest gnulib c_stack_action
503 calling conventions.
504 * src/diff.c (main): Likewise.
505 * src/diff3.c (main): Likewise.
506 * src/sdiff.c (main): Likewise.
507
508 * src/cmp.c (main): Adjust to latest version_etc calling conventions.
509 * src/diff.c (main): Likewise.
510 * src/diff3.c (main): Likewise.
511 * src/sdiff.c (main): Likewise.
512
513 * src/diff.c: Include <exit.h>.
514 (binary): Define to true if not declared.
515 (longopts): Set tabsize flag to 1.
516 (main): Don't output nanoseconds if platform lacks them.
517 Don't treat files as binary if !binary.
518 (set_mtime_to_now): Use 0, not NULL.
519 (compare_files): Mark files as nonexistent if it looks like
520 'patch' created inaccessible regular empty files to denote
521 nonexistent backups. Don't compare such files.
522 Clear st_* members of status of nonexistent file.
523 Remove now-unnecessary tests.
524
525 * src/diff.h: Include regex.h, unlocked-io.h.
526 (struct file_data.changed): Now char *, not bool *, to save
527 space on hosts where bool takes more space than char.
528 All uses changed.
529
530 * src/diff3.c: Include unlocked-io.h.
531 (strip_trailing_cr): New var.
532 (STRIP_TRAILING_CR_OPTION): New enum.
533 (longopts, main, option_help_msgid, read_diff):
534 Add --strip-trailing-cr support.
535 (read_diff): Exit with status 126 (not 127) if errno != ENOENT
536 after failed execvp in child. Report this in parent.
537
538 * src/dir.c: Include <strcase.h>.
539 (failed_locale_specific_sorting): Renamed from failed_strcoll.
540 All uses changed.
541 (compare_names): Don't invoke strcasecmp first thing when
542 ignore_file_name_case; if locale_specific_sorting, we should
543 just use that.
544
545 * src/ifdef.c (next_line): Remove; replace with...
546 (next_line0, next_line1): New vars.
547 (print_ifdef_script, print_ifdef_hunk):
548 Use them to fix line-number computation bug.
549
550 * src/io.c (find_and_hash_each_line): Don't convert char *
551 to unsigned char *; just leave pointers as char *. This
552 lessens the number of potentially-dangerous casts.
553 * src/util.c (lines_differ): Likewise.
554
555 * src/sdiff.c: Include <unlocked-io.h>, <exit.h>.
556 (check_child_status): Renamed from ck_editor_status, and
557 accept a new arg MAX_OK_STATUS. All callers changed.
558 Handle status 126/127 as per POSIX.
559 (edit): Likewise.
560 (main): Likewise. Fix getopt typo: -E wasn't supported.
561
562 * src/system.h (S_IRWXU, S_IRWXG, S_IRWXO): Define if not defined.
563 (S_IXUSR, S_IXGRP, S_IXOTH): Remove.
564 Include <time.h> unconditionally, since we can assume C89 now.
565 Likewise for <stdlib.h>, <string.h>.
566 (getenv, EXIT_SUCCESS, EXIT_FAILURE, SSIZE_MAX, strchr, strrchr,
567 memcmp, memcpy): Remove decl; no longer needed.
568 (strcasecoll, strcasecmp): Define if not built in.
569 (CTYPE_DOMAIN, ISPRINT, ISSPACE, TOLOWER, _tolower, errno): Remove;
570 we now assume C89 or better. All uses changed.
571 Include <stdbool.h> unconditionally now, since gnulib supports it
572 if the C compiler doesn't. All boolean uses of 0 and 1 now
573 changed to false and true.
574 (lin_is_printable_as_long_int): Renamed from lin_is_printable_as_long.
575
576 * src/util.c (begin_output): Fix bug: 0 wasn't cast to char * arg,
577 which led to undefined behavior on 64-bit hosts.
578 Use more-standard test for exit status 126 versus 127.
579 (finish_output): Likewise.
580 (analyze_hunk): Do not cast bool to int.
581
5822004-03-15 Paul Eggert <eggert@twinsun.com>
583
584 * src/cmp.c (main): Don't consider two files with the same name to
585 be the same, if their initial skip values differ. This fixes a
586 bug reported by Hideki Iwamoto in
587 <http://mail.gnu.org/archive/html/bug-gnu-utils/2004-03/msg00024.html>.
588
5892004-03-11 Paul Eggert <eggert@twinsun.com>
590
591 * src/analyze.c (diag): Return void, not lin, since the return
592 value wasn't needed. All callers changed.
593 (diag, diff_2_files):
594 Use 'true' and 'false' instead of '1' and '0', when appropriate.
595 (compareseq): Use lin const * local variables instead of lin *.
596 Don't bother checking diag's return value.
597 (shift_boundaries, build_reverse_script, build_script, diff_2_files):
598 Use char arrays, not bool arrays, since
599 sizeof (bool) might be greater than 1.
600
6012004-02-09 Paul Eggert <eggert@twinsun.com>
602
603 * m4/setmode.m4 (AC_FUNC_SETMODE_DOS): AC_LIBOBJ(setmode) if
604 we would return true.
605
6062002-10-14 Paul Eggert <eggert@twinsun.com>
607
608 * src/Makefile.am (diff3.$(OBJEXT), diff.$(OBJEXT),
609 sdiff.$(OBJEXT)): Rename from (misspelled) diff3.$(OBJECT),
610 diff.$(OBJECT), sdiff.$(OBJECT). Patch by Paul D. Smith in
611 <http://mail.gnu.org/pipermail/bug-gnu-utils/2002-October/003251.html>.
612 Bug reported by Chris Bainbridge.
613
6142002-10-13 Paul Eggert <eggert@twinsun.com>
615
616 * src/Makefile.am (MOSTLYCLEANFILES): Add paths.ht.
617 (paths.h): Send output to paths.ht first, and then rename to
618 paths.h at the end. This avoids problems if the disk is full.
619 It also works around what appears to be a bug with GNU make -j
620 (3.79.1); see <http://bugs.gentoo.org/show_bug.cgi?id=8934>.
621
6222002-06-27 Paul Eggert <eggert@twinsun.com>
623
624 * NEWS, configure.ac (AC_INIT): Version 2.8.4.
625
626 * config/config.sub: Sync with latest version maintained in other
627 packages.
628
629 * lib/file-type.h: Protect against double inclusion. Detect
630 whether <sys/stat.h> has been included. Fix from Jim Meyering.
631
632 * src/analyze.c (briefly_report): Don't say "Binary files differ",
633 since one of the files may not be a binary file.
634 Bug reported by Dan Jacobson.
635
6362002-06-22 Paul Eggert <eggert@twinsun.com>
637
638 * lib/c-stack.c (segv_handler, c_stack_action) [! defined
639 SA_SIGINFO]: Do not assume SA_SIGINFO behavior.
640 Bug reported by Jim Meyering on NetBSD 1.5.2.
641
6422002-06-16 Paul Eggert <eggert@twinsun.com>
643
644 * NEWS, configure.ac (AC_INIT): Version 2.8.3.
645
646 * config/depcomp, config/missing, README: Update to automake 1.6.2.
647
648 * po/LINGUAS: Add en_US.
649 * po/en_US.po: New file.
650 * po/POTFILES.in: Remove lib/freesoft.c.
651 Add lib/file-type.c, lib/version-etc.c, lib/xmalloc.c.
652
6532002-06-15 Paul Eggert <eggert@twinsun.com>
654
655 * doc/diff.texi (Special Files): Document behavior of symlink
656 loops.
657
658 * lib/Makefile.am (noinst_HEADERS): Remove freesoft.h.
659 Add version-etc.h.
660 (libdiffutils_a_SOURCES): Remove freesoft.c. Add version-etc.c.
661 * lib/freesoft.c, lib/freesoft.h: Remove.
662 * lib/version-etc.h (PARAMS): Remove; we now assume C89 at least.
663
664 * lib/version-etc.h (version_etc): Remove package and version args.
665 (version_etc_copyright): Remove.
666 * lib/version-etc.c: Likewise.
667 Do not include unlocked-io.h; no longer needed.
668 Include gettext.h rather than libinto.h.
669 (_): Define unconditionally.
670 (version_etc): Adjust wording to match current GNU coding standards.
671 Translate "(C)" if possible.
672
673 * lib/version-etc.c, lib/version-etc.h: New files, taken from
674 fileutils.
675
676 * src/Makefile.am (cmp_SOURCES, diff3_SOURCES, sdiff_SOURCES,
677 diff_SOURCES): Remove version.c.
678 (MAINTAINERCLEANFILES, $(srcdir)/version.c): Remove.
679
680 * src/cmp.c: Include version-etc.h, not freesoft.h.
681 (copyright_notice): Remove.
682 (main): Use version_etc to print version.
683 * src/diff.c, src/diff3.c, src/sdiff.c: Likewise.
684
685 * src/cmp.c (version_string): Remove decl.
686 * src/diff.h, src/diff3.c, src/sdiff.c: Likewise.
687
6882002-06-11 Paul Eggert <eggert@twinsun.com>
689
690 * lib/fnmatch.c, lib/fnmatch_loop.c (WIDE_CHAR_SUPPORT):
691 New macro. Use it uniformly instead of
692 (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
693 It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
694 reported by Vin Shelton.
695 * m4/fnmatch.m4 (_AC_LIBOBJ_FNMATCH): Check for btowc.
696
697 * NEWS, configure.ac (AC_INIT): Version 2.8.2.
698
699 * ABOUT-NLS, config/config.guess, config/config.sub,
700 config/depcomp, config/texinfo.tex, lib/posix/regex.h,
701 m4/c-bs-a.m4, m4/gettext.m4, m4/gnu-source.m4, m4/lib-link.m4,
702 m4/malloc.m4:
703 Update to recent version (maintained in other packages).
704 * m4/prereq.m4 (jm_PREREQ_EXCLUSIVE): AC_FUNC_FNMATCH_GNU
705 no longer takes a lib.
706
707 * README: Incorporate contents from INSTALLME.
708 * INSTALLME: Remove.
709 * Makefile.am (EXTRA_DIST): Remove INSTALLME.
710
711 * configure.ac (AC_GNU_SOURCE): Move up, so that it affects
712 later compilations properly.
713 (DEFAULT_DIFF_PROGRAM, AC_TYPE_SIGNAL): Remove.
714 (jm_AC_TYPE_INTMAX_T): Add.
715 (AC_FUNC_FNMATCH_GNU): Use this, instead of AC_FUNC_FNMATCH.
716 (AC_CONFIG_LINKS): regex.hin renamed from regex_.h.
717
718 * doc/diff.texi: Reword "@option{-f} and @option{--foo}" to
719 "@option{-f} or @option{--foo}".
720 Use @acronym instead of @sc where appropriate.
721 (Specified Lines): Renamed from Specified Folding.
722 (Comparison, Blank Lines):
723 Clarify wordings for Blank Lines and Specified Lines nodes.
724 (Binary): Mention --verbose and --print-bytes.
725 (Tabs, sdiff Option Summary, diff Options):
726 New option --tabsize=COLUMNS.
727
728 * lib/Makefile.am (EXTRA_DIST): Add fnmatch_loop.c.
729 (noinst_HEADERS): fnmatch_.h renamed from fnmatch.hin.
730 regex_.h renamed from regex.hin.
731 Add file-type.h.
732 (libdiffutils_a_SOURCES): Add file-type.c.
733 (DISTCLEANFILES): Remove fnmatch.hno, regex.hno.
734
735 * lib/c-stack.c (__attribute__): New macro.
736 (EOVERFLOW): Define if not defined.
737 (stack_t): Define to struct sigaltstack if not defined or declared.
738 Include <sys/resource.h>, <ucontext.h> if available.
739 Include <stdio.h> if DEBUG.
740 Do not include <inttypes.h> or <stdint.h>.
741 (c_stack_die): Remove info and context args. All uses changed.
742 (segv_action): Likewise.
743 (alternate_signal_stack): Change uintmax_t to long, to ease porting.
744 (get_stack_location, min_address_from_argv, max_address_from_argv,
745 null_action): New functions.
746 (stack_base, stack_size): New vars.
747 (segv_handler): context arg may not be used.
748 Use global stack_base, stack_size if
749 ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC.
750 Add debug code.
751 Invoke die (rather than segv_action) to exit.
752 (c_stack_action): Accept new argv arg, and simpler handler arg.
753 All uses changed. Move code into new functions above.
754 Allow null action.
755 [! (defined SA_ONSTACK && defined _SC_PAGESIZE)]: Assume all segvs
756 are stack overflows.
757 (main) [DEBUG]: Describe what output should be like.
758
759 * lib/c-stack.h (siginfo_t, c_stack_die): Remove decl.
760
761 * lib/file-type.c, lib/file-type.h: New files. These contain code
762 that was in src/diff.c, but is now librarified and spiffed up a
763 bit. Jim Meyering suggested this.
764
765 * lib/fnmatch.c (alloca, __builtin_expect): Define for non-GCC hosts.
766 <strings.h>: Include only if HAVE_STRINGS_H.
767 <stddef.h>: Include if we include stdlib.h.
768 Do not comment out all code if ! HAVE_FNMATCH_GNU.
769 (getenv): Do not declare if HAVE_DECL_GETENV.
770 (__strchrnul, __wcschrnul): Remove; not used.
771 (MEMPCPY): Use mempcpy if not _LIBC; use memcpy if neither _LIBC
772 nor HAVE_MEMPCPY.
773 (FOLD) [HANDLE_MULTIBYTE]: Do not pass wide char to ISUPPER.
774 (STRLEN, STRCAT, MEMPCPY) [HANDLE_MULTIBYTE && !defined _LIBC]:
775 Use wcslen rather than __wcslen, and likewise for wcscat, wmempcpy.
776 (MEMPCPY) [HANDLE_MULTIBYTE]: Use wmempcpy if not _LIBC; use wmemcpy
777 if neither _LIBC nor HAVE_WMEMPCPY.
778 * lib/fnmatch_.h (__const): Do not define to empty, as this breaks
779 Sun cc. The code doesn't work with K&R anyway.
780 * lib/fnmatch_loop.c (struct patternlist.str): Size 1, not 0,
781 as C89 requires this.
782 (NEW_PATTERN): Use offsetof, not sizeof, since str now has size 1.
783 * lib/fnmatch_.h: Import from glibc fnmatch.h.
784 * lib/fnmatch.c, lib/fnmatch_loop.c: Import from glibc.
785
786 * lib/posixver.c: Include posixver.h.
787
788 * lib/regex_.h: Renamed from lib/regex.hin.
789
790 * m4/c-stack.m4 (jm_PREREQ_C_STACK): Do not AC_REQUIRE
791 jm_AC_TYPE_UINTMAX_T and do not use uintmax_t.
792 Check for sys/resource.h, uccontext.h.
793 Check for decls and existence of getcontext, sigaltstack.
794 Check for stack_t.
795
796 * m4/codeset.m4, m4/glibc21.m4, m4/lcmessage.m4: Remove.
797
798 * m4/fnmatch.m4: Update to latest Autoconf CVS for AC_FUNC_FNMATCH_GNU.
799 * m4/gnu-source.m4: Likewise, for AC_GNU_SOURCE (renamed from
800 AC__GNU_SOURCE).
801
802 * m4/mbstate_t.m4 (AC_TYPE_MBSTATE_T): Renamed from AC_MBSTATE_T.
803 All uses changed. Upgrade to recent Autoconf CVS.
804
805 * m4/stdbool.m4 (AC_HEADER_STDBOOL): Do not cast pointer to
806 bool in integer constant expression; C99 does not allow it.
807 Reported by Bruno Haible.
808
809 * po/LINGUAS: Add hu, pt_BR.
810 * po/hu.po, po/pt_BR.po: New files.
811
812 * src/Makefile.am (noinst_HEADERS): Remove diff.h.
813 (DEFS): Remove.
814 (diff_sources): Add diff.h.
815 (MOSTLYCLEANFILES): New macro.
816 (cmp.$(OBJEXT) diff3.$(OBJECT) diff.$(OBJECT) sdiff.$(OBJECT)): Depend
817 on paths.h.
818 (paths.h): New rule.
819
820 * src/analyze.c, src/cmp.c, src/diff.c, src/diff3.c, src/io.c,
821 src/sdiff.c: Include <file-type.h>.
822
823 * src/cmp.c: Include paths.h.
824 (copyright_notice): Renamed from copyright_string.
825 Now a msgid, so that copyright symbol can be translated.
826 All uses changed.
827 * src/diff.c, src/diff3.c, src/sdiff.c: Likewise.
828
829 * src/diff.c: Include posixver.h.
830 (TABSIZE_OPTION): New constant.
831 (main): Allow widths up to SIZE_MAX.
832 (filetype): Move to lib/file-type.c and rename to file_type.
833 All uses changed.
834
835 * src/diff.c (longopts, main, usage): New option --tabsize=COLUMNS.
836 * src/io.c (find_and_hash_each_line): Likewise.
837
838 * src/diff.h (TAB_WIDTH): Remove.
839 (tabsize): New decl.
840 (sdiff_half_width, sdiff_column2_offset): Now size_t rather than
841 unsigned int.
842
843 * src/diff3.c (skipwhite, readnum): New functions.
844 (process_diff_control): Use them.
845 (SKIPWHITE, READNUM): Remove.
846 (read_diff): Don't worry about errno == ENOEXEC.
847
848 * src/sdiff.c (catchsig, signal_handler, initial_action): Signal
849 handlers return void, not RETSIGTYPE, since we no longer support
850 K&R.
851 (TABSIZE_OPTION): New constant.
852 (longopts, usage, main): New option --tabsize=COLUMNS.
853 (cleanup): New arg signo. All uses changed.
854 (ck_editor_status, main, edit): Don't worry about ENOEXEC.
855
856 * src/side.c (tab_from_to, print_half_line, print_1sdiff_line):
857 New option --tabsize=COLUMNS.
858
859 * src/system.h (S_ISBLK, S_ISCHR, S_ISDIR, S_ISFIFO, S_ISREG,
860 S_ISSOCK): Remove; now in lib/file-type.h.
861
862 * src/util.c (finish_output): Check for ENOEXEC.
863 (lines_differ, output_1_line): New option --tabsize=COLUMNS.
864 (analyze_hunk): If -b or -w is also specified, -B now considers
865 lines to be empty if they contain only white space.
866
8672002-04-05 Paul Eggert <eggert@sic.twinsun.com>
868
869 * NEWS, configure.ac (AC_INIT): Version 2.8.1.
870
871 * configure.ac (AC_HEADER_STDBOOL): Add.
872 (AC_CHECK_HEADERS): Remove stdbool.h.
873 * m4/stdbool.m4: New file.
874 * m4/prereq.m4 (jm_PREREQ_EXCLUDE):
875 Use AC_HEADER_STDBOOL rather than AC_CHECK_HEADERS(stdbool.h).
876 (jm_PREREQ_HASH): Likewise.
877
878 * src/system.h (SSIZE_MAX): Define if limits.h doesn't.
879
880 * src/analyze.c (diff_2_files): Assign PTRDIFF_MAX - 1 to a
881 size_t variable, just in case there's a problem with ptrdiff_t
882 versus size_t.
883
884 * lib/cmpbuf.c (errno): Remove decl; K&R C is no longer supported.
885 Include limits.h.
886 (SIZE_MAX, SSIZE_MAX): Define if standard headers don't.
887 (MIN): New macro.
888 (block_read): Do not attempt to read more than SSIZE_MAX bytes, as the
889 resulting behavior is implementation-defined. Work around bug in
890 Tru64 5.1, which can't read more than INT_MAX bytes at a time.
891 * src/cmp.c (cmp): Use block_read instead of read, to work
892 around Tru64 5.1 bug.
893 * src/diff3.c (read_diff): Likewise.
894 * src/diff3.c: Include cmpbuf.h.
895
896 * THANKS: Add Ulrich Drepper.
897
898 * INSTALLME: Mention GNU texinfo.
899
900 * doc/diff.texi:
901 Use new @copying directive.
902 Put @contents first, not last, since Texinfo now suggests this.
903 Fix bug in -w documentation noted by Karl Berry.
904 Mention links for speedup.
905 New node "Speedups" for future speedups.
906 Just say "Index", not "Concept Index".
907
9082002-03-26 Paul Eggert <eggert@twinsun.com>
909
910 * src/Makefile.am:
911 (INCLUDES): Remove this obsolete macro, replacing it with:
912 (AM_CPPFLAGS): New macro.
913
9142002-03-26 Albert Chin-A-Young <china@thewrittenword.com>
915
916 * src/Makefile.am (datadir): Remove, as it conflicts with --datadir.
917
9182002-03-26 Paul Eggert <eggert@twinsun.com>
919
920 * doc/diff.texi (dircategory GNU packages): Fix typo: a "* " was
921 missing before the menu entry. Bug diagnosed by Adam Heath.
922 Also, put this dircategory after the Individual utilities dircategory,
923 to work around a compatibility problem with Debian install-info.
924
9252002-03-24 Eli Zaretskii <eliz@is.elta.co.il>
926
927 * src/io.c (sip): Do not mishandle buffered count when reverting
928 to text mode.
929
9302002-03-23 Paul Eggert <eggert@twinsun.com>
931
932 * NEWS, configure.ac (AC_INIT): Version 2.8.
933 * configure.ac (AC_PREREQ): 2.53.
934 * INSTALLME: Upgrade to gettext 0.11.1 and help2man 1.27.
935
936 * doc/diff.texi: Upgrade the description of `patch' to GNU patch
937 2.5.4, and revamp the documentation accordingly.
938
939 * src/diff.c (main): Fix typo that prevented diff -y from working.
940 Bug reported by Mitsuru Chinen.
941
9422002-03-15 Paul Eggert <eggert@twinsun.com>
943
944 * lib/c-stack.c (c_stack_die) [!HAVE_SIGINFO_T]: Don't use info.
945 Bug reported by Eli Zaretskii.
946
9472002-03-15 Eli Zaretskii <eliz@is.elta.co.il>
948
949 * ms/config.sed: Tweak editing of install-info-am target.
950
9512002-03-12 Paul Eggert <eggert@twinsun.com>
952
953 * NEWS, configure.ac (AC_INIT): Version 2.7.10.
954
955 * NEWS: cmp -l -s and cmp -s -l are not allowed.
956 Deprecate diff -h, -H, -L, -P, --inhibit-hunk-merge.
957
958 * configure.ac (jm_PREREQ_HARD_LOCALE): Add.
959 (AM_INIT_AUTOMAKE): Do not distribute shar file.
960
961 * doc/diff.texi (Overview): byte != character.
962 (Detailed Context, Detailed Unified, Alternate Names, diff Options):
963 Do not document diff -L.
964 (Comparing Directories, Making Patches, diff Options):
965 Do not document diff -P.
966 (diff Performance, sdiff Option Summary, diff Options, sdiff Options):
967 Do not document diff -H.
968 (diff Performance, diff Options): Do not document --horizon-lines.
969 (cmp Options): Prefer -b to -c.
970 (cmp Options, diff Options, diff3 Options, patch Options,
971 sdiff Options): Put short options next to the similar long options.
972 Document --help, and use the same wording for --verbose.
973 (diff3 Options): Fix typo in description of -E, which used wrongly used
974 "-e" instead of "-E".
975
976 * lib/hard-locale.c (alloca): Remove.
977 Include stdlib.h if available, for malloc.
978 (hard_locale): Use malloc, not alloca, so that we need not worry about
979 alloca issues. Test for storage allocation failure.
980
981 * m4/prereq.m4 (jm_PREREQ): Add jm_PREREQ_HARD_LOCALE.
982 (jm_PREREQ_HARD_LOCALE): New macro.
983
984 * src/cmp.c (specify_comparison_type): New function.
985 (check_stdout): "indices and codes" -> "byte numbers and values"
986 (main): Detect clashing options.
987 (cmp): Use "byte" rather than "char" if a translation for "byte"
988 is available, even when in the POSIX locale.
989
990 * src/diff.c (option_help_msgid): Do not document -L, -P,
991 --horizon-lines, --inhibit-hunk-merge, -H.
992 * src/diff.h: -L -> --label
993
9942002-03-11 Paul Eggert <eggert@twinsun.com>
995
996 * NEWS, configure.ac (AC_INIT): Version 2.7.9.
997
998 * INSTALLME: Update to autoconf 2.53, automake 1.6, help2man
999 1.25 with patch.
1000
1001 * configure.ac (AC_INIT):
1002 Change package name from diff to diffutils.
1003 (AM_INIT_AUTOMAKE): Use new form, with option gnits,
1004 rather than old from that duplicated AC_INIT.
1005 (AM_MISSING_PROG): Add help2man.
1006 (REGEX_MALLOC): Define.
1007 (AC_CONFIG_FILES): Add man/Makefile.
1008
1009 * Makefile.am (AUTOMAKE_OPTIONS): Remove.
1010 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
1011 * lib/Makefile.am (AUTOMAKE_OPTIONS): Likewise.
1012 * ms/Makefile.am (AUTOMAKE_OPTIONS): Likewise.
1013 * src/Makefile.am (AUTOMAKE_OPTIONS): Likewise.
1014
1015 * lib/c-stack.c: Include <errno.h>
1016 (ENOTSUP): Define if errno.h doesn't.
1017 (SA_NODEFER, SA_ONSTACK, SA_RESETHAND, SA_SIGINFO, SIGSTKSZ,
1018 _SC_PAGESIZE, ALTERNATE_STACK_SIZE, stack_t, sigaltstack):
1019 Remove; we now assume them all when
1020 HAVE_XSI_STACK_OVERFLOW_HEURISTIC, so we don't need
1021 substitutes.
1022 (<ucontext.h>): Include only if HAVE_XSI_STACK_OVERFLOW_HEURISTIC.
1023 (alternate_signal_stack): Now of size SIGSTKSZ.
1024 (segv_handler): Simplify, under the assumption that
1025 HAVE_XSI_STACK_OVERFLOW_HEURISTIC is nonzero.
1026 (c_stack_action): Likewise.
1027 (exit_failure) [DEBUG]: Initialize to 0, not 1.
1028 (recurse, main) [DEBUG]: Remove main args.
1029
1030 * m4/c-stack.m4 (AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC): Change
1031 wording of message. Do not check for stdbool.h or ucontext.h,
1032 or for ucontext_t or sigaction or sigaltstack.
1033
1034 * po/LINGUAS: Add zh_TW.
1035
1036 * Makefile.am (SUBDIRS): Add man.
1037 * man/Makefile.am: New file.
1038 * src/cmp.c (usage): Reword for help2man.
1039 * src/diff.c (option_help_msgid): Likewise.
1040 * src/diff3.c (option_help_msgid, usage): Likewise.
1041 * src/sdiff3.c (option_help_msgid, usage): Likewise.
1042 Reword for help2man.
1043
1044 * THANKS: Add email address for Tower.
1045
1046 * config/config.guess, config/config.sub, config/depcomp,
1047 config/install-sh, config/mdate-sh, config/missing,
1048 config/mkinstalldirs, config/texinfo.tex: Update
1049 to recent version (maintained in other packages).
1050
10512002-03-04 Bruno Haible <haible@ilog.fr>
1052
1053 * m4/gettext.m4 (AM_GNU_GETTEXT): Set LIBINTL and LTLIBINTL to empty if
1054 no preinstalled GNU gettext was found.
1055
10562002-03-02 Eli Zaretskii <eliz@is.elta.co.il>
1057
1058 * ms/config.sed: Tweak editing of install-info-am and
1059 uninstall-info-am targets, to include 8+3-butchered names of Info
1060 files.
1061
10622002-02-28 Paul Eggert <eggert@twinsun.com>
1063
1064 * NEWS, configure.ac (AC_INIT, AM_INIT_AUTOMAKE): Version 2.7.8.
1065
1066 * doc/diff.texi: Add vr index.
1067 Update copyright to 2002.
1068 (Standards conformance): New chapter.
1069 (Binary): Differing binary files are trouble unless the user asked for
1070 brief output.
1071 (Detailed Context): Prefer ISO time stamp format in discussion.
1072 (Detailed Unified, Pagination): Likewise.
1073 (Less Context): Likewise. Also use short option.
1074 (Alternate Names): Separate option from arg.
1075 (Making Patches): Mention -U 2.
1076 (diff Options): Deprecate -LINES, as POSIX 1003.1-2001 does not
1077 allow it.
1078
1079 * INSTALLME: Update advice for Solaris installation problems.
1080 We no longer use a test version of gettext.
1081 Autoconf test version updated from 2.52f to 2.52h.
1082 POSIX 1003.1-2001 patch for Automake.
1083
1084 * configure.ac (AC__GNU_SOURCE): Add this,
1085 replacing AH_VERBATIM of _GNU_SOURCE.
1086 (tempname): Use AC_LIBOBJS, not LIBOBJS=, as now required by autoconf.
1087 (jm_PREREQ_C_STACK): Add.
1088 (AC_CONFIG_FILES): Remove intl/Makefile.
1089 (AM_GNU_GETTEXT): Add external arg, from gettext 0.11.
1090
1091 * lib/c-stack.c, lib/c-stack.h, lib/exitfail.c, lib/exitfail.h,
1092 lib/posixver.c, lib/posixver.h, m4/c-stack.m4, m4/gnu-source.m4,
1093 po/cs.po, po/ja.po: New files.
1094
1095 * intl/ChangeLog, intl/Makefile.in, intl/VERSION,
1096 intl/bindtextdom.c, intl/config.charset, intl/dcgettext.c,
1097 intl/dcigettext.c, intl/dcngettext.c, intl/dgettext.c,
1098 intl/dngettext.c, intl/explodename.c, intl/finddomain.c,
1099 intl/gettext.c, intl/gettextP.h, intl/gmo.h, intl/hash-string.h,
1100 intl/intl-compat.c, intl/l10nflist.c, intl/libgnuintl.h,
1101 intl/loadinfo.h, intl/loadmsgcat.c, intl/localcharset.c,
1102 intl/locale.alias, intl/localealias.c, intl/localename.c,
1103 intl/ngettext.c, intl/os2compat.c, intl/os2compat.h, intl/osdep.c,
1104 intl/plural-eval.c, intl/plural-exp.c, intl/plural-exp.h,
1105 intl/plural.c, intl/plural.y, intl/ref-add.sin, intl/ref-del.sin,
1106 intl/textdomain.c, m4/isc-posix.m4, m4/libtool.m4: Remove.
1107
1108 * ABOUT-NLS: Update to Gettext 0.11.
1109
1110 * Makefile.am (SUBDIRS): Remove intl.
1111
1112 * config/config.guess, config/config.rpath, config/config.sub,
1113 config/texinfo.tex, config/depcomp, config/texinfo.tex,
1114 lib/tempname.c: Update to latest version from other packages.
1115
1116 * lib/xalloc.h (xalloc_exit_failure): Remove; subsumed by exit_failure.
1117 * lib/xmalloc.c: Include exitfail.h.
1118 (xalloc_exit_failure): Remove; subsumed by exit_failure.
1119 All uses changed.
1120
1121 * lib/Makefile.am (noinst_HEADERS): Add c-stack.h, exitfail.h.
1122 (libdiffutils_a_SOURCES): Add c-stack.c, exitfail.c, quotesys.c.
1123 (INCLUDES): Remove.
1124
1125 * lib/cmpbuf.h (buffer_lcm): New arg LCM_MAX.
1126 * lib/cmpbuf.c: Include errno.h.
1127 (errno): Declare if !STDC_HEADERS.
1128 Include signal.h.
1129 (SA_RESTART): Define if not already defined.
1130 Include <inttypes.h>.
1131 (PTRDIFF_MAX): Define if not already defined.
1132 (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Likewise.
1133 (block_read): Accommodate ancient AIX hosts that set errno to EINTR
1134 after uncaught SIGCONT.
1135 (buffer_lcm): Return a reasonable size if the multiple is too large.
1136 New arg LCM_MAX. All callers changed.
1137
1138 * lib/hard-locale.c: Include "hard-locale.h".
1139 (hard_locale): Ignore ENABLE_NLS, since we want to operate on
1140 locales other than LC_MESSAGES.
1141
1142 * m4/prereq.m4 (jm_PREREQ): Add jm_PREREQ_POSIXVER.
1143 (jm_PREREQ_POSIXVER): New macro.
1144
1145 * m4/setmode.m4 (AC_FUNC_SETMODE_DOS):
1146 Check for fcntl.h and unistd.h unconditionally.
1147 Suggested by Bruno Haible.
1148
1149 * po/LINGUAS: Add cs, ja.
1150 * po/POTFILES.in: Add lib/c-stack.c, src/dir.c.
1151
1152 * src/Makefile.am (datadir): @DATADIRNAME@ -> share.
1153 (INCLUDES): Remove intl.
1154 (LDADD): Change INTLLIBS to LIBINTL.
1155 No longer need to link libdiffutils.a twice.
1156
1157 * src/analyze.c (diff_2_files):
1158 Avoid arithmetic overflow in buffer size calculation.
1159
1160 * src/cmp.c: Include c-stack.h, exitfail.h.
1161 (hard_locale_LC_MESSAGES): Depend on ENABLE_NLS.
1162 (try_help, check_stdout, main, cmp): 2 -> EXIT_TROUBLE.
1163 (main): Check for stack overflow.
1164 0 -> EXIT_SUCCESS.
1165 1 -> EXIT_FAILURE.
1166 (cmp): Likewise.
1167 Accommodate ancient AIX hosts that set errno to
1168 EINTR after uncaught SIGCONT.
1169
1170 * src/context.c (pr_context_hunk):
1171 Do not dump core if an enormous context causes an
1172 arithmetic overflow.
1173 (pr_unidiff_hunk): Likewise.
1174 (find_hunk): Likewise.
1175
1176 * src/diff.h: unsigned -> unsigned int.
1177 * src/diff.c: Include c-stack.h, exitfail.h.
1178 Do not include signal.h.
1179 (specify_style, specify_value): Bring these routines back, as POSIX
1180 requires that the order of options not matter.
1181 (shortopts): New constant.
1182 (group_format_option, line_format_option): New constants.
1183 (main): 0 -> EXIT_SUCCESS, 1 -> EXIT_FAILURE, 2 -> EXIT_TROUBLE.
1184 Ensure that order of options does not matter.
1185 Check for stack overflow.
1186 If contexts overflow, substitute LIN_MAX, as that's good enough.
1187 If multiple contexts are specified, use their maximum.
1188 -c is equivalent to -C 3 now, instead of having an implicit context;
1189 likewise for -u and -U 3.
1190 Use specify_style and specify_value.
1191 (SIGCHLD): Do not define; now done in a header.
1192 Use new style time stamp format for -u / -U.
1193 Reject numeric-string options if operating in POSIX 1003.1-2001 mode.
1194 Avoid overflow problems with tab width.
1195 Simplify from-file and to-file code.
1196 (usage): Do not mention obsolete options.
1197 (filetype): Do not mention whether a file is executable.
1198 Add typed memory objects.
1199 (compare_files): 0 -> EXIT_SUCCESS, 1 -> EXIT_FAILURE, 2 ->
1200 EXIT_TROUBLE.
1201
1202 * src/diff3.c: Include c-stack.h, exitfail.h.
1203 (ALLOCATE): Remove. All uses changed to xmalloc, or to xmalloc plus
1204 an overflow check.
1205 (myread): Remove.
1206 (main): Check for stack overflow.
1207 0 -> EXIT_SUCCESS, 1 -> EXIT_FAIULRE, 2 -> EXIT_TROUBLE.
1208 (try_help): Likewise.
1209 (process_diff): Check for integer overflow, to avoid core dumps.
1210 2 -> EXIT_TROUBLE.
1211 (read_diff): Exit with status 126 if the file is not executable,
1212 for compatibility with POSIX 1003.1-2001.
1213 Accommodate ancient AIX hosts that set errno to EINTR after uncaught
1214 SIGCONT.
1215 Check for integer overflow to avoid core dumps.
1216 (fatal, perror_with_exit): 2 -> EXIT_TROUBLE.
1217
1218 * src/dir.c (dir_read):
1219 Ignore st_size of directories: POSIX says it's garbage.
1220 Check for integer overflow to avoid core dumps.
1221 (diff_dirs): 0 -> EXIT_SUCCESS, 2 -> EXIT_TROUBLE.
1222
1223 * src/ifdef.c: Include <xalloc.h>.
1224 (format_group, print_ifdef_lines): Avoid core dumps with bad formats.
1225 (do_printf_spec): Avoid alloca.
1226
1227 * src/io.c (sip):
1228 Avoid integer overflow and core dumps if buffer alignments are
1229 preposterously incompatible.
1230 (slurp): Do not dump core if the file is growing as we read it.
1231 If a regular file grows, keep reading until we catch up with its EOF.
1232 (find_and_hash_each_line): Check for integer overflow to avoid cores.
1233 (GUESS_LINES): Remove.
1234 (guess_lines): New function. Avoid integer overflow.
1235 (find_identical_ends): Use it.
1236 Avoid integer overflow and possible core dumps.
1237
1238 * src/sdiff.c: Include c-stack.h, exitfail.h. Do not include signal.h.
1239 0 -> EXIT_SUCCESS, 1 -> EXIT_FAILURE, 2 -> EXIT_TROUBLE.
1240 (ck_editor_status): New function.
1241 (main): Check for stack overflow.
1242 Adopt POSIX convention for subsidiary programs not found.
1243 (diffarg): Check for integer overflow to avoid core dumps.
1244 (trapsigs): Remove SA_INTERRUPT special case; now done by header.
1245 (SIGCHLD): Likewise.
1246 (edit): Adopt POSIX convention for subsidiary programs not found.
1247
1248 * src/side.c: unsigned -> unsigned int.
1249
1250 * src/system.h: Don't use alloca or include <alloca.h>.
1251 unsigned -> unsigned int
1252 (EXIT_SUCCESS, EXIT_FAILURE, EXIT_TROUBLE): Define if not defined.
1253 Include signal.h.
1254 (SA_RESTART): Define if not defined.
1255 (SIGCHLD): Likewise.
1256
1257 * src/util.c: 2 -> EXIT_TROUBLE.
1258 Adopt POSIX convention for ENOEXEC and exit status 126.
1259 unsigned -> unsigned int
1260
12612002-01-24 Paul Eggert <eggert@twinsun.com>
1262
1263 * NEWS, configure.ac (AC_INIT, AM_INIT_AUTOMAKE): Version 2.7.7.
1264
1265 * intl/plural.c: Regenerate with Bison 1.31.
1266
1267 * ABOUT-NLS, intl/*: Update to Gettext 0.11-pre5++.
1268 * INSTALL: Update to Autoconf 2.52f.
1269
1270 * INSTALLME: New file.
1271 * Makefile.am (EXTRA_DIST): Add config/config.rpath, INSTALLME.
1272 (DISTCLEANFILES): Remove.
1273 * NEWS: Reformat for imminent 2.8 release.
1274 * README: Mention INSTALLME.
1275 * README-alpha: Move most of contents to INSTALLME.
1276 * THANKS: Add Bruno Haible, Jim Meyering, and Eli Zaretskii.
1277
1278 * config: New subdirectory, containing the following files from .:
1279 config.guess, config.sub, depcomp, missing, install-sh, mkinstalldirs.
1280 Move the following files here from doc: texinfo.tex, mdate-sh.
1281 * config/config.guess, config/config.sub, config/texinfo.tex:
1282 Update to latest version from FSF.
1283 * config/config.rpath: New file, from Gettext 0.11-pre5++.
1284
1285 * configure.ac (AC_INIT): Use new 3-arg form.
1286 (AC_CONFIG_SRCDIR): Specify src/diff.c here, not in AC_INIT.
1287 (ALL_LINGUAS): Remove: now in po/LINGUAS as per Gettext 0.11.
1288 (AC_CONFIG_AUX_DIR): New macro invocation.
1289
1290 * lib/Makefile.am (noinst_HEADERS): Add gettext.h.
1291 * lib/gettext.h: New file, from Gettext 0.11-pre5++.
1292 * lib/prepargs.c: Include <string.h>. Reported by Bruno Haible.
1293
1294 * m4/codeset.m4, m4/gettext.m4, glibc21.m4, iconv.m4, isc-posix.m4,
1295 lcmessage.m4, progtest.m4: Upgrade to Gettext 0.11-pre5++.
1296 * m4/lib-ld.m4, m4/lib-link.m4, m4/lib-prefix.m4: New files, from
1297 Gettext 0.11-pre5++.
1298
1299 * po/LINGUAS: New file.
1300 * po/Makefile.in.in: Upgrade to Gettext 0.11-pre5++.
1301 * po/Makevars, po/Rules-quot, po/boldquot.sed: New files,
1302 from Gettext 0.11-pre5++.
1303
1304 * src/cmp.c (copyright_string): Update to 2002.
1305 * src/diff.c (copyright_string): Likewise.
1306 * src/diff3.c (copyright_string): Likewise.
1307 * src/sdiff.c (copyright_string): Likewise.
1308
1309 * src/cmp.c (specify_ignore_initial): Renamed from
1310 parse_ignore_initial, with different signature, to take the
1311 maximum of multiple options rather than the last one.
1312 All uses changed.
1313
1314 * src/cmp.c (bytes, specify_ignore_initial, cmp): Use UINTMAX_MAX
1315 instead of (uintmax_t) -1, to avoid warnings on some compilers.
1316 * src/io.c (file_block_read): Likewise, for SIZE_MAX.
1317
1318 * src/cmp.c (usage): Reformat messages to ease translation.
1319 * src/diff3.c (usage): Likewise.
1320 * src/sdiff.c (usage): Likewise.
1321
1322 * src/cmp.c (main): Two files with the same name are identical
1323 only if the same offset is specified.
1324 (block_compare_and_count): Avoid cast to unsigned char.
1325
1326 * src/diff3.c (main): Remove unused variable.
1327
1328 * src/dir.c: Include <setjmp.h>
1329 (struct dirdata): New member nnames.
1330 (locale_specific_sorting, failed_strcoll): New vars.
1331 (dir_read): Renamed from dir_sort. Don't sort the dir.
1332 Set new nnames member of struct dirdata. All callers changed.
1333 (compare_names): Don't check for errno after strcasecmp.
1334 Use strcoll only if locale_specific_sorting is nonzero.
1335 If strcoll fails, longjmp out rather than returning a value
1336 that might result in an invalid comparison function that might
1337 make qsort dump core.
1338 (diff_dirs): Sort the directory ourselves. Use setjmp to recover
1339 from strcoll failure, falling back on native byte comparison.
1340 Make local variables volatile if they need to preserve their value
1341 after setjmp/longjmp.
1342
1343 * src/sdiff.c (handler_index_of_SIGINT, handler_index_of_SIGPIPE):
1344 New macros.
1345 (main): Do not confuse signal numbers with their indices.
1346 Bug reported by Bruno Haible.
1347 (edit): Cat lin to long before printing with %ld, since lin might
1348 be narrow than long.
1349
1350 * src/system.h (UINTMAX_MAX): New macro.
1351 Include gettext.h, not libgettext.h.
1352 (N_): Do not wrap arg in parentheses. Fix from Bruno Haible.
1353
1354 * src/util.c (finish_output): Ensure that werrno is initialized.
1355 (lines_differ): Have an explicit do-nothing case for
1356 IGNORE_NO_WHITE_SPACE, to pacify gcc -Wall.
1357
13582001-12-29 Eli Zaretskii <eliz@is.elta.co.il>
1359
1360 * src/sdiff.c (interact): After extracting rlen from the editor
1361 command, test for a terminating null character, not for a newline.
1362
1363 * ms/config.bat: Allow longer source directory names without
1364 overflowing the line length limits. Create the cache in the
1365 build directory, not in the source directory
1366 * ms/config.sed: Fix AC_CONFIG_LINKS for when symlinks are
1367 unavailable.
1368
13692001-12-23 Paul Eggert <eggert@twinsun.com>
1370
1371 * NEWS, configure.ac (AM_INIT_AUTOMAKE): Version 2.7.6.
1372
1373 * configure.ac (ALL_LINGUAS): Add tr.
1374
1375 * src/util.c (begin_output):
1376 Have child exit with status 127 rather than reporting
1377 failure on its own. Set errno to 0 before invoking popen.
1378 (finish_output): Report errno on pclose failure.
1379 Distinguish between subsidiary program not found, and failure.
1380
1381 * src/sdiff.c (not_found, execdiff): Remove.
1382 (DIFF_PROGRAM_OPTION): New constant.
1383 (longopts, option_help_msgid, main): Add --diff-program=PROGRAM.
1384 (check_stdout): New function.
1385 (main): Remove DIFF_PROGRAM. Check stdout after printing version.
1386 Use check_stdout after printing help. Use execvp/perror_fatail rather
1387 than execdiff. Set errno to 0 before invoking popen.
1388 Check for pclose failure properly.
1389 (main, edit): If child exec fails, exit with 127 rather than trying to
1390 print diagnostic.
1391 Distinguish between subsidiary program failing and not being found.
1392 (edit): Handle signals the same way, regardless of whether we're using
1393 system or fork+exec. Check for system returning -1.
1394
1395 * src/diff3.c (DIFF_PROGRAM_OPTION, HELP_OPTION): New constants.
1396 (longopts, main): Use them.
1397 (longopts, main, option_help_msgid): New option --diff-option=PROGRAM.
1398 (main): Remove DIFF_PROGRAM support.
1399 Check stdout after printing version.
1400 (check_stdout): Report errno info if fclose fails.
1401 (read_diff): Have child exit with status 127 when program is not found,
1402 rather than trying to have the child report failure. Check for
1403 pclose returning -1.
1404
1405 * src/diff.c (DEFAULT_WIDTH): Remove.
1406 (main): Use 130 instead of DEFAULT_WIDTH, since it's not really
1407 builder-settable. Do not prepend DIFF_OPTIONS.
1408 (check-stdout): If fclose (stdout) fails, print errno info.
1409 (option_help_msgid): Default context is 3, not 2.
1410 (usage): Work even if ptrdiff_t is wider than int.
1411
1412 * doc/diff.texi (diff Options): Remove DIFF_OPTIONS.
1413 (Invoking diff3, Invoking sdiff): Remove DIFF_PROGRAM.
1414 (diff3 Options, sdiff Options): Add --diff-program.
1415
1416 * src/cmp.c (valid_suffixes):
1417 Add '0', to support suffixes like "MB" and "MiB".
1418 (check_stdout): Don't assume that the translations of "write failed"
1419 and of "standard output" lack '%'.
1420 (main): Check stdout after printing version.
1421
1422 * lib/setmode.c: [HAVE_FCNTL_H && HAVE_SETMODE_DOS]: Include <fcntl.h>.
1423 [!HAVE_SETMODE_DOS]: Do not include <unistd.h>.
1424 (set_binary_mode): Return mode (not 1) if fd is a tty.
1425 Do not assume that O_TEXT is zero.
1426
1427 * doc/diff.texi (cmp Options):
1428 In byte counts, a plain suffix (without any integer)
1429 is assumed to modify the integer 1. Index terms like "kibibyte".
1430 Document plain "k".
1431
1432 (Reporting Bugs): Mention bug-report archive and test version
1433 location. Ask for "diff --version" in bug reports.
1434
14352001-12-13 Paul Eggert <eggert@twinsun.com>
1436
1437 * src/diff.c (DEFAULT_WIDTH): Remove; couldn't be changed without
1438 also changing option_help_msgid. All uses replaced with 130.
1439
1440 * lib/setmode.c: Include fcntl.h and unistd.h only if
1441 HAVE_SETMODE_DOS.
1442 (setmode): Assume a file is binary unless the mode is O_TEXT.
1443 * ms/README: Fix minor typos.
1444
14452001-12-13 Eli Zaretskii <eliz@is.elta.co.il>
1446
1447 * ms/README: New file.
1448
1449 * lib/setmode.c (set_binary_mode) [HAVE_SETMODE_DOS]: Don't assume
1450 O_TEXT has a zero value. If FD is a terminal device, do nothing
1451 and return MODE, thus pretending that it was already in the
1452 requested MODE.
1453 [HAVE_FCNTL_H]: Include fcntl.h (needed for O_BINARY).
1454
1455 * ms/config.sed: Remove the split prevention of config.status.
1456 Fix Sed commands for converting absolute file names into
1457 top_srcdir-relative ones.
1458
1459 * ms/config.bat: Fix typos.
1460
14612001-12-12 Neal H Walfield <neal@cs.uml.edu>
1462
1463 * diff.c (option_help_msgid): Correct the default context width
1464 from 2 to 3.
1465
14662001-12-11 Paul Eggert <eggert@twinsun.com>
1467
1468 * m4/Makefile.am.in: Remove jm-glibc-io.m4
1469
1470 * NEWS, configure.ac (AM_INIT_AUTOMAKE): Version 2.7.5.
1471
1472 * configure.ac (PR_PROGRAM): Use AC_DEFINE_UNQUOTED, so that
1473 $PR_PROGRAM is expanded by sh.
1474 (ptrdiff_t, ssize_t): Use AC_CHECK_TYPE with a default of int,
1475 not AC_CHECK_TYPES.
1476 (jm_AC_DOS, AC_FUNC_SETMODE_DOS): New macros.
1477 (AC_CONFIG_FILES): Add ms/Makefile.
1478
1479 * doc/diff.texi: Add --no-ignore-file-name-case.
1480 File name case sensitivity now affects file name exclusion.
1481 Fix typos.
1482
1483 * src/util.c: Include dirname.h.
1484 (dir_file_pathname): Use base_name rather than file_name_lastdirchar.
1485
1486 * src/system.h (S_IXUSR, S_IXGRP, S_IXOTH): New macros.
1487 Include <libgettext.h> rather than rolling it ourselves.
1488 (file_name_lastdirchar, HAVE_SETMODE, set_binary_mode): Remove.
1489
1490 * src/sdiff.c: Include <dirname.h>.
1491 (expand_name): Use base_name rather than file_name_lastdirchar, for
1492 portability to DOS.
1493 (main): Initialize xalloc_exit_failure before possibly invoking
1494 any memory allocator.
1495
1496 * src/io.c: Include setmode.h.
1497
1498 * src/diff3.c (main):
1499 Initialize xalloc_exit_failure before possibly invoking any memory
1500 allocator.
1501
1502 * src/diff.c: Include dirname.h, setmode.h.
1503
1504 (main): Later values and/or styles now silently override earlier.
1505 (specify_value, specify_style): Likewise. All callers changed.
1506 Remove.
1507 (binary, main, option_help_msgid, compare_files):
1508 HAVE_SETMODE -> HAVE_SETMODE_DOS.
1509 (NO_IGNORE_FILE_NAME_CASE_OPTION): New constant.
1510 (longopts, main, option_help_msgid): Support it.
1511 (exclude_options): New function.
1512 (main): Use it. Initialize xalloc_exit_failure before potentially
1513 allocating memory.
1514
1515 (filetype): Distinguish executable files from others, as POSIX
1516 suggests.
1517
1518 (compare_files): Use base_name instead of file_name_lastdirchar.
1519
1520 * src/cmp.c: Include <hard-locale.h>, <setmode.h>.
1521 (hard_locale_LC_MESSAGES): New macro.
1522 (sprintc): Remove int width arg; it's now the caller's responsibility
1523 to pad. All callers changed.
1524 (stat_buf): New static var; was formerly a local var in 'main'.
1525 (valid_suffixes): Add 'K', for 'KiB'.
1526 (option_help_msgid): Don't confuse bytes with characters.
1527 (main): Set xalloc_exit_failure before invoking anything that might
1528 allocate memory. Fix bug: -n was incorrectly ignored when optimizing
1529 the case of regular files with different lengths.
1530 (cmp): Use an index column wide enough to store this comparison's
1531 indexes. In locales other than the POSIX locale, say "byte"
1532 rather than "char".
1533
1534 * ms/config.bat: pc -> ms
1535
1536 * ms/Makefile.am, m4/setmode.m4, lib/setmode.c, lib/setmode.h:
1537 New file.
1538
1539 * lib/Makefile.am (noinst_HEADERS): Add dirname.h, setmode.h.
1540 (libdiffutils_a_SOURCES): Add basename.c, setmode.c.
1541
1542 * Makefile.am (SUBDIRS): Add ms.
1543
15442001-12-10 Paul Eggert <eggert@twinsun.com>
1545
1546 * m4/fnmatch.m4: Test for FNM_CASEFOLD.
1547
15482001-12-03 Paul Eggert <eggert@twinsun.com>
1549
1550 * lib/posix/regex.h: Fix copyright notice.
1551
15522001-12-03 Paul Eggert <eggert@twinsun.com>
1553
1554 * NEWS, configure.ac (AM_INIT_AUTOMAKE): Version 2.7.4.
1555
1556 * diff.texi (direntry, Overview, Comparison, Binary, Invoking cmp):
1557 Use "byte" rather than "character" when talking about cmp, since
1558 it compares bytes, not character.
1559 (Invoking cmp): New trailing operands FROM-SKIP and TO-SKIP.
1560 -i or --ignore-initial now accepts FROM-SKIP:TO-SKIP.
1561 New option -n or --bytes.
1562 Count operands now may be in octal or hex, and may be followed by a
1563 size multiplier.
1564
1565 * configure.ac (DEFAULT_DIFF_PROGRAM):
1566 Define to "diff", not "$bindir/diff" (which didn't work anyway).
1567 (AC_CHECK_MEMBERS): Add struct stat.st_blksize, struct stat.st_rdev.
1568 (AC_STRUCT_ST_BLKSIZE, AC_STRUCT_ST_RDEV): Remove; obsolescent.
1569 (AC_FUNC_FORK): Use this, instead of obsolescent AC_FUNC_VFORK.
1570 (AC_CONFIG_FILES, AC_CONFIG_COMMANDS): Add.
1571 (AC_OUTPUT): Remove args; they were obsolescent.
1572
1573 * util.c (setup_output, begin_output, finish_output):
1574 HAVE_FORK -> HAVE_WORKING_FORK || HAVE_WORKING_VFORK.
1575 * sdiff.c (diffpid, cleanup, main, edit): Likewise.
1576 * diff3.c (read_diff): Likewise.
1577
1578 * system.h (STAT_BLOCKSIZE):
1579 Use HAVE_STRUCT_STAT_ST_BLKSIZE, not HAVE_ST_BLKSIZE.
1580 (vfork): New macro.
1581 (HAVE_FORK): Remove.
1582 (set_binary_mode): New macro.
1583
1584 * sdiff.c (main): HAVE_VFORK -> HAVE_WORKING_VFORK.
1585 (edit): Reopen the temporary file after the editor has run, in case
1586 the editor operates by unlinking the old file and linking a new one.
1587 (P_tmpdir): Rename from PVT_tmpdir; this fixes a typo.
1588 All uses changed.
1589
1590 * io.c (sip, read_files):
1591 Remove tests for HAVE_SETMODE; use set_binary_mode
1592 instead of setmode.
1593 (sip): Fix typo in backward lseek when reverting to text mode.
1594
1595 * config.site, config.sed, config.bat: New file.
1596
1597 * Makefile.am (EXTRA_DIST): Add xstrtol.c.
1598 (noinst_HEADERS): Add xstrtol.h.
1599 (libdiffutils_a_SOURCES): Add xstrtoumax.c.
1600
1601 * cmp.c: <xstrtol.h>: Include.
1602 (ignore_initial): Now an array with 2 elements. All uses changed.
1603 (bytes): New var.
1604 (HELP_OPTION): New constant.
1605 (long_options, main): Use it.
1606 (long_options, option_help_msgid, main, cmp):
1607 Add support for -n or --bytes.
1608 (parse_ignore_initial): New function.
1609 (option_help_msgid, main): Add -i M:N.
1610 (usage, main): Add two optional trailing operands, a la BSD.
1611 (main): setmode -> set_binary_mode.
1612 (cmp): Report byte number of what we've seen, not of the entire file.
1613 This is to be consistent with the line number, which is always relative
1614 with what we've seen.
1615
16162001-12-02 Paul Eggert <eggert@twinsun.com>
1617
1618 * diff.c (main, compare_files): setmode -> set_binary_mode.
1619
1620 * xstrtol.c (__xstrtol): Don't accept 'Ki'; require 'KiB'.
1621
1622 * xstrtol.c (__xstrtol): Add support for IEC 60027-2.
1623
16242001-11-25 Paul Eggert <eggert@twinsun.com>
1625
1626 * NEWS, configure.ac (AM_INIT_AUTOMAKE): Version 2.7.3.
1627
1628 * README-alpha: New file.
1629
1630 * src/Makefile.am (INCLUDES): Add -I../lib, for regex.h.
1631
1632 * configure.ac:
1633 Don't set LIB_CLOCK_GETTIME to 'none required'; set it to
1634 the empty string instead.
1635
1636 * lib/Makefile.am (EXTRA_DIST): Add strtoimax.c, strtol.c.
1637
1638 * Makefile.am (SUBDIRS): Put intl before lib, so that libintl.h exists.
1639
1640 * lib/Makefile.am (noinst_HEADERS): Add unlocked-io.h.
1641
1642 * configure.ac (__EXTENSIONS__): New define, for the unlocked macros.
1643
1644 * README: Add copyright notice.
1645 Remove stuff that doesn't apply any more.
1646
1647 * doc/diff.texi: offsets -> indices for cmp
1648
1649 * src/cmp.c (option_help_msgid): offsets -> indices
1650
1651 * src/diff.c (option_help_msgid):
1652 Don't mention --binary on POSIX hosts.
1653
1654 * src/sdiff.c (STRIP_TRAILING_CR_OPTION): New constant.
1655 (longopts, option_help_msgid, main): Add -E, --ignore-tab-expansion,
1656 --strip-trailing-cr.
1657
1658 * doc/diff.texi: Change direcategory from Utilities to GNU Packages.
1659 Add individual utilities.
1660 Switch to Free Documentation License.
1661 @code -> @command
1662 @samp -> @option
1663 GNU -> @sc{gnu}
1664 Expand tabs to spaces, except when in an example that actually
1665 uses tabs.
1666 Prefer @node with just one arg.
1667 Document -E or --ignore-tab-expansion, --strip-trailing-cr,
1668 --ignore-file-name-case.
1669 Regular expressions are now grep style, not Emacs style.
1670 cmp's -c or --print-chars option is now -b or --print-bytes.
1671 Time stamps now depend on LC_TIME.
1672 -p now implies ^[[:alpha:]$_].
1673 Flags now include ' and 0.
1674 cmp -i is an alias for --ignore-initial
1675 Document --from-file, --to-file.
1676 Document DIFF_OPTIONS.
1677
1678 * configure.ac (AC_CHECK_FUNCS): Add gettimeofday, clock_gettime.
1679 (LIB_CLOCK_GETTIME): New subst.
1680
1681 * src/system.h: Assume C89 or better.
1682 (_GNU_SOURCE): Remove; config.h now defines it.
1683 (alloca): Declare like coreutils does it.
1684 (verify, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, O_RDWR,
1685 S_IRUSR, S_IWUSR): New macros.
1686 (STAT_BLOCKSIZE): Parenthesize definiens.
1687 <inttypes.h>: Include if HAVE_INTTYPES_H.
1688 (CHAR_MAX, INT_MAX): Remove.
1689 (PTRDIFF_MAX, SIZE_MAX): New macros.
1690 (strtoumax): New decl.
1691 Include stddef.h.
1692 (bzero): Remove.
1693 (bindtextdomain, textdomain, N_): New macros.
1694 (ISPRINT, ISSPACE): Remove ifndef wrappers.
1695 (ISUPPER, ISDIGIT): Remove.
1696 (TOLOWER): New macro.
1697 (MIN): Renamed from min; all callers changed.
1698 (MAX): Likewise, from max.
1699 (lin): New type.
1700 (LIN_MAX): New macro.
1701 (file_name_cmp): Renamed from filename_cmp. All callers changed.
1702 (file_name_lastdirchar): Renamed from file_name_lastdirchar.
1703 All callers changed.
1704 (could_be_mvfs_stat_bug, could_be_nfs_stat_bug,
1705 dev_may_have_duplicate_ino): Remove.
1706 (HAVE_SETMODE, NULL_DEVICE): New macros.
1707 (same_file): Do not check attributes.
1708 (same_file_attributes): New macro.
1709
1710 * src/util.c: Assume C89 or better.
1711 int -> bool for booleans.
1712 int -> lin for line numbers.
1713 int -> size_t for sizes.
1714 Use angle-brackets when including quotesys.h.
1715 Include error.h, regex.h, xalloc.h.
1716 (message5): sizeof -> offsetof
1717 (begin_output): Invoke pr without -f.
1718 (lines_differ): Renamed from line_cmp, and return bool not 3-way int.
1719 All callers changed.
1720 Add support for IGNORE_TAB_EXPANSION.
1721 (change_letter): Now an array rather than a function. All
1722 callers changed.
1723 (translate_range): Translate line numbers to long, not lin,
1724 for convenience with printf.
1725 (analyze_hunk): Return enum changes instead of a count of
1726 inserts and deletes. All callers changed.
1727 (zalloc): New function.
1728
1729 * src/side.c: Assume C89 or better.
1730 int -> bool for booleans.
1731 int -> lin for line numbers.
1732
1733 * src/sdiff.c: Assume C89 or better.
1734 int -> bool for booleans.
1735 int -> lin for line numbers.
1736 Use angle-brackets when including getopt.h, quotesys.h.
1737 Include error.h, freesoft.h, stdio.h, xalloc.h.
1738 (copyright_string): Use only most recent year.
1739 (authorship_msgid, option_help_msgid): Wrap in N_().
1740
1741 (tmpname): Now volatile.
1742 (tmpmade): Remove.
1743 (tmp): New var.
1744 (private_tempnam, exists, letters): Remove.
1745 (temporary_file): New function.
1746 (edit): Use it.
1747 (interact): Use strtoumax, not atoi.
1748
1749 * src/normal.c: Assume C89 or better.
1750 int -> lin for line numbers.
1751
1752 * src/io.c: Assume C89 or better.
1753 int -> bool for booleans.
1754 int -> lin for line numbers.
1755 int -> size_t for sizes.
1756 Use angle-brackets when including cmpbuf.h.
1757 Include regex.h, xalloc.h.
1758 (word): Remove; now done in system.h.
1759 (hash_value): New type; use it instead of 'unsigned' for hash values.
1760 (file_block_read): New function.
1761 (sip, slurp): Use it. Now static.
1762 (sip): Ensure block size is a multiple of word size. Clear eof flag.
1763 (slurp): Use xalloc_die to report memory exhaustion.
1764 (find_and_hash_each_line): Use TOLOWER instead of _tolower.
1765 Add support for IGNORE_TAB_EXPANSION.
1766 (prepare_text_end): Strip trailing CR if requested.
1767 (find_identical_ends): Prepare the text only once,
1768 if they're duplicates.
1769 Let the compiler take advantage more of the fact that the buffers are
1770 word-aligned.
1771 (primes): Remove.
1772 (prime_offset): New var.
1773 (read_var): Use prime_offset instead of primes.
1774 Use zalloc instead of xmalloc + bzero.
1775
1776 * src/ifdef.c: Assume C89 or better.
1777 int -> lin for line numbers.
1778 (format_group): Use strtoumax to parse line numbers.
1779 (format_group, print_ifdef_lines): Use do_printf_spec to
1780 handle printf specs.
1781 (groups_letter_value): Don't use _tolower; it's locale-dependent.
1782 (do_printf_spec): Renamed from scan_printf_spec; now does the printing.
1783
1784 * src/ed.c: Assume C89 or better.
1785 int -> lin for line numbers (or 'long' when that's more convenient).
1786 (print_ed_hunk): Fix bug when handling double-dot inserts.
1787
1788 * src/dir.c: Assume C89 or better.
1789 int -> bool for booleans.
1790 Include error.h, exclude.h, xalloc.h.
1791
1792 (dir_sort): Return 0 on error, 1 on success. All callers changed.
1793 compare_names -> compare_names_for_qsort.
1794
1795 (compare_names): Try strcasecmp if ignore_file_name_case. Then try
1796 strcoll. Use file_name_cmp only as a last resort. Warn about
1797 strcasecmp or strcoll failure.
1798 (compare_names_for_qsort): New function.
1799
1800 (diff_dirs): Use compare_names rather than filename_cmp.
1801
1802 * src/diff3.c: Assume C89 or better.
1803 int -> bool for booleans.
1804 int -> lin for line numbers.
1805 Use angle-brackets when including getopt.h, quotesys.h.
1806 Include error.h, freesoft.h, inttostr.h, xalloc.h.
1807 (copyright_string): Use only most recent year.
1808 (authorship_msgid, option_help_msgid): Wrap in N_().
1809
1810 Rename the following variables for consistency with user-visible
1811 option spellings. All uses changed.
1812 (text): Renamed from always_text.
1813 (initial_tab): Renamed from tab_align_flag.
1814
1815 (horizon_lines): Remove. Remove all uses.
1816
1817 (main): Invoke bindtextdomain and textdomain after setlocale.
1818 Rename "DIFF" to "DIFF_PROGRAM".
1819
1820 Try to compare file0 to file1, because this is where changes are
1821 expected to come from. Diffing between these pairs of files is more
1822 likely to avoid phantom changes from file0 to file1.
1823 However, use file2 as the common file if this is a 3-way diff,
1824 for backward compatibility. Suggested by Karl Tomlinson.
1825
1826 (create_diff3_block): Use xcalloc instead of malloc + bzero.
1827
1828 (INT_STRLEN_BOUND): Remove; now in system.h.
1829
1830 (read_diff): Always use --horizon-lines=100 rather than trying
1831 to guess it.
1832 Do not pass --inhibit-hunk-merge.
1833 Minimum chunk size is 1, not 8KiB.
1834 Use xalloc_die to report memory exhaustion.
1835 (undotlines): Use long for start, not int.
1836
1837 * src/diff.h: Assume C89 or better.
1838 int -> bool for booleans.
1839 int -> lin for line numbers.
1840 Don't include regex.h.
1841 (enum changes): New enum.
1842 (enum line_class): Remove; subsumed by enum changes.
1843 (enum output_style): New constant OUTPUT_UNSPECIFIED.
1844
1845 (ignore_space_change_flag, ignore_all_space_flag): Remove.
1846 (ignore_white_space): New decl, subsuming the above two. All
1847 uses changed.
1848
1849 Rename the following decls for consistency with user-visible
1850 option spellings. All uses changed.
1851 (text): Renamed from always_text_flag.
1852 (ignore_blank_lines): Renamed from ignore_blank_lines_flag.
1853 (ignore_case): Renamed from ignore_case_flag.
1854 (brief): Renamed from no_details_flag.
1855 (initial_tab): Renamed from tab_align_flag.
1856 (expand_tabs): Renamed from tab_expand_flag.
1857 (starting_file): Renamed from dir_start_file.
1858 (paginate): Renamed from paginate_flag.
1859 (sdiff_merge_assist): Renamed from sdiff_help_sdiff.
1860 (left_column): Renamed from sdiff_left_only.
1861 (suppress_common_lines): Renamed from sdiff_skip_common_lines.
1862 (speed_large_files): Renamed from heuristic.
1863 (minimal): Renamed from no_discards.
1864
1865 (inhibit_hunk_merge): Remove.
1866
1867 (strip_trailing_cr, excluded, time_format): New decls.
1868
1869 (files_can_be_treated_as_binary): Renamed from ignore_some_changes.
1870
1871 (group_format, line_format): Now char const *[], not char *[].
1872
1873 (struct file_data): Buffer is now word*, not char*, as it's always
1874 aligned and this can help the compiler. buffered_chars -> buffered
1875 (since it's a byte count, not a char count). All uses changed.
1876 New member `eof'.
1877
1878 (FILE_BUFFER): New macro.
1879
1880 (excluded_filename, error, free_software_msgid): Remove decls; now in
1881 other .h files.
1882
1883 (sip, slurp): Remove decls.
1884 (file_block_read): New decl.
1885 (change_letter): Now an array, not a function.
1886 (lines_differ): Renamed from line_cmp.
1887 (analyze_hunk): Now returns enum changes rather than two change counts.
1888
1889 * src/Makefile.am (diff_LDADD): New symbol.
1890
1891 * src/diff.c: Assume C89 or better.
1892 int -> bool for booleans.
1893 long -> off_t for line numbers.
1894 Use angle-brackets when including getopt.h, fnmatch.h, quotesys.h.
1895 Include error.h, exclude.h, freesoft.h, hard-locale.h, prepargs.h,
1896 regex.h, signal.h, xalloc.h.
1897 (copyright_string): Use only most recent year.
1898 (authorship_msgid, option_help_msgid): Wrap in N_().
1899
1900 Rename the following variables for consistency with user-visible
1901 option spellings. All uses changed.
1902 (binary): Renamed from binary_flag.
1903 (new_file): Renamed from entire_new_file_flag.
1904 (unidirectional_new_file): Renamed from unidirectional_new_file_flag.
1905 (report_identical_files): Renamed from print_file_same_flag.
1906
1907 (numeric_arg): Remove.
1908
1909 (exclude, exclude_alloc, exclude_count, excluded_filename, add_exclude,
1910 add_exclude_file):
1911 Remove; now done by exclude.h.
1912
1913 (BINARY_OPTION, FROM_FILE_OPTION, HELP_OPTION, HORIZON_LINES_OPTION,
1914 IGNORE_FILE_NAME_CASE_OPTION, INHIBIT_HUNK_MERGE_OPTION,
1915 LEFT_COLUMN_OPTION, LINE_FORMAT_OPTION, NORMAL_OPTION,
1916 SDIFF_MERGE_ASSIST_OPTION, STRIP_TRAILING_CR_OPTION,
1917 SUPPRESS_COMMON_LINES_OPTION, TO_FILE_OPTION,
1918 UNCHANGED_LINE_FORMAT_OPTION, OLD_LINE_FORMAT_OPTION,
1919 NEW_LINE_FORMAT_OPTION, UNCHANGED_GROUP_FORMAT_OPTION,
1920 OLD_GROUP_FORMAT_OPTION, NEW_GROUP_FORMAT_OPTION,
1921 CHANGED_GROUP_FORMAT_OPTION): New constants.
1922 (longopts, main): Use them.
1923
1924 (longopts, main, option_help_msgid): Add -E, --from-file, --to-file.
1925
1926 (main): Invoke bindtextdomain and textdomain after setlocale.
1927 Use grep syntax, not Emacs, for regular expressions.
1928 Use exclude.h, not our own functions.
1929 Use ISO 8601 time format in hard locales.
1930 Prepend DIFF_OPTIONS.
1931 Don't update ignore_some_changes.
1932 Use strtoumax instead of numeric_arg.
1933 Use specify_value when appropriate.
1934 error -> try_help when appropriate.
1935 -p now means ^[[:alpha:]$_], not ^[_a-zA-Z$].
1936 Ignore --inhibit-hunk-merge.
1937 Prefer changed group formats to unchanged ones.
1938 Remove now-unnecessary casts.
1939 Set files_can_be_treated_as_binary.
1940
1941 (specify_value): Renamed from specify_format. All uses changed.
1942
1943 (specify_style): Default is now unspecified, not normal. All
1944 uses changed.
1945
1946 (set_mtime_to_now): New function.
1947 (compare_files): Use it. Use memset, not bzero.
1948 Set stdin mtime to current time even when stdin is not a regular file.
1949 Check for same file attributes, as well as for same file.
1950 Use files_can_be_treated_as_binary.
1951 "write failed" -> "standard output on output failure.
1952
1953 * src/context.c: Assume C89 or better.
1954 int -> lin for line numbers.
1955 Include inttostr.h, regex.h.
1956 (TIMESPEC_NS): New macro.
1957 (nstrftime): New decl.
1958 (print_context_label): Use nstrftime and time_format to format times.
1959 Print numeric time stamp value if localtime fails.
1960 (print_context_function): New function.
1961 (pr_context_hunk, pr_unidiff_hunk): Use it.
1962 (find_function): Use size_t for sizes, not int.
1963
1964 * src/cmp.c: Assume C89 or better.
1965 int -> bool for booleans.
1966 long -> off_t for line numbers.
1967 Use angle-brackets when including cmpbuf.h, getopt.h.
1968 Include error.h, freesoft.h, inttostr.h, xalloc.h.
1969 (copyright_string): Use only most recent year.
1970 (authorship_msgid): Wrap in N_().
1971 (buffer): Now word*, not char*. All uses changed.
1972 (word): Remove macro; now in system.h.
1973 (long_options, option_help_msgid, main): -c --print-chars ->
1974 -b --print-bytes
1975 (check_stdout): "write failed" -> "standard output"
1976 (option_help_msgid): Wrap in N_().
1977 (main): Invoke bindtextdomain and textdomain after setlocale.
1978 Use strtoumax instead of doing the work ourselves.
1979 Check for same_file_attributes as well as same_file.
1980 (cmp): Use ssize_t for read returns, not size_t.
1981 Do not assume that size_t is not narrower than int.
1982 Do not assume that line numbers fit in 'long'.
1983 (block_compare_and_count, block_compare):
1984 Compiler now checks that buffers are word-aligned.
1985 (block_compare_and_count): Count sizes with size_t, not long.
1986 (sprintc): byte arg is unsigned char, not unsigned.
1987
1988 * src/analyze.c: Assume C89 or better.
1989 int -> lin for line numbers.
1990 int -> bool for booleans.
1991 unsigned int -> size_t for sizes.
1992 Use angle-brackets when including cmpbuf.h.
1993 Include error.h, regex.h, xalloc.h.
1994 (discard_confusing_lines, diff_2_files): Use zalloc rather
1995 than xalloc+bzero.
1996 (discard_confusing_lines): unsigned int -> lin for values that
1997 are really line numbers.
1998 (shift_boundaries): Do not inhibit hunk merges.
1999 (build_reverse_script, build_script, diff_2_files): Use |, not ||.
2000 (diff_2_files): no_details_flag & ~ignore_some_changes ->
2001 files_can_be_treated_as_binary. Esure that buffer size is a multiple
2002 of sizeof (word). Use file_block_read to read buffers.
2003 (diff_2_files): Abort if output style is not one of the
2004 expected styles.
2005
20062001-11-23 Paul Eggert <eggert@twinsun.com>
2007
2008 * src/Makefile.am, m4/vararrays.m4: New file.
2009
2010 * m4/prereq.m4 (jm_PREREQ_READUTMP):
2011 Remove, as it gives autoheader the willies.
2012
2013 * m4/README, lib/prepargs.h, lib/prepargs.c, lib/offtostr.c,
2014 lib/umaxtostr.c, lib/inttostr.c, lib/inttostr.h,
2015 lib/imaxtostr.c, lib/freesoft.h: New files.
2016
2017 * lib/freesoft.c: Include config.h, freesoft.h rather than diff.h.
2018 (free_software_msgid): Wrap contents in N_.
2019
2020 * lib/cmpbuf.h: Use prototypes instead of old-style functions.
2021
2022 * lib/cmpbuf.c:
2023 Don't include system.h; instead, include config.h, unistd.h.
2024 Use prototypes instead of old-style functions.
2025 (block_read): Don't assume that int is no wider than size_t.
2026
2027 * lib/Makefile.am, po/POTFILES.in: New file.
2028
20292001-11-22 Paul Eggert <eggert@twinsun.com>
2030
2031 * pc/config.h:
2032 Define filename_cmp as an object-like macro, not as a function-like
2033 macro.
2034
2035 * exgettext: Always operate in the C locale.
2036 Set AWK using a method that works even with broken shells.
2037
2038 * doc/Makefile.am: New file.
2039
2040 * configure.ac (AC_INIT):
2041 Use src/diff.c, not diff.h, as the source files got removed.
2042 (AM_CONFIG_HEADER): Switch from AC_CONFIG_HEADER.
2043 (AC_ARG_PROGRAM, AC_MINIX): Remove.
2044
2045 (AC_PREREQ, AM_INIT_AUTOMAKE, ALL_LINGUAS, AC_PROG_AWK,
2046 AM_PROG_CC_STDC, AC_PROG_RANLIB, AC_C_INLINE, AC_C_VARARRAYS,
2047 DEFAULT_DIFF_PROGRAM, DEFAULT_EDITOR_PROGRAM,
2048 AC_STRUCT_ST_MTIM_NSEC): Add.
2049
2050 (PR_PROGRAM): AC_DEFINE.
2051
2052 (AC_SYS_LARGEFILE): Use instead of our homebrew version.
2053
2054 (_GNU_SOURCE): Define if not defined.
2055
2056 (AC_CHECK_HEADERS): Add stdbool.h, unistd.h.
2057 (AC_CHECK_TYPES): Add ptrdiff_t, uintmax_t.
2058 (AM_GNU_GETTEXT, XGETTEXT): Add.
2059
2060 (WITH_MVFS_STAT_BUG, WITH_NFS_STAT_BUG): Remove.
2061 (HAVE_MEMCHR): Remove.
2062 (AC_CHECK_FUNCS): Add diraccess.
2063 (AC_REPLACE_FUNCS): Add memchr, waitpid.
2064 (jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_GNU_STRFTIME, jm_FUNC_MALLOC,
2065 jm_FUNC_REALLOC, jm_PREREQ_ERROR, jm_PREREQ_QUOTEARG, jm_PREREQ_REGEX,
2066 jm_PREREQ_TEMPNAME, jm_AC_PREREQ_XSTRTOUMAX, AC_FUNC_FNMATCH): Add.
2067 (fnmatch.h, regex.h): Do not create these files unless we're using
2068 our own fnmatch and regex.
2069
2070 (AC_OUTPUT): Add doc/Makefile, intl/Makefile, lib/Makefile,
2071 lib/posix/Makefile, m4/Makefile, po/Makefile.in, src/Makefile.
2072
2073 * Makefile.am: New file.
2074
2075 * po/en_GB.po: Don't translate "program" to "programme".
2076
20772001-11-20 Paul Eggert <eggert@twinsun.com>
2078
2079 * m4/prereq.m4: New file.
2080
20812001-03-16 Paul Eggert <eggert@twinsun.com>
2082
2083 * lib/tempname.c (uint64_t):
2084 Define if not defined, and if UINT64_MAX is not defined.
2085
20862001-02-26 Paul Eggert <eggert@twinsun.com>
2087
2088 * lib/tempname.c: glibc 1.32
2089
20902001-02-17 Paul Eggert <eggert@twinsun.com>
2091
2092 * m4/Makefile.am.in: GNU fileutils 4.1
2093
20942001-01-09 Paul Eggert <eggert@twinsun.com>
2095
2096 * lib/tempname.c (struct_stat64): New macro.
2097 (direxists, __gen_tempname): Use it. This avoids a portability problem
2098 with Solaris 8.
2099
2100 * lib/tempname.c (<config.h>): Include if HAVE_CONFIG_H.
2101 (<stddef.h>, <stdint.h>, <string.h>):
2102 Include only if STDC_HEADERS || _LIBC.
2103 (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
2104 (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
2105 (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
2106 (__set_errno): Define this macro if <errno.h> doesn't.
2107 (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
2108 Define these macros if <stdio.h> doesn't.
2109 (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
2110 Define these macros if <sys/stat.h>
2111 doesn't. Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
2112 (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
2113 __xstat64): Define if not _LIBC.
2114 (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
2115 (__gen_tempname): Invoke gettimeofday only if HAVE_GETTIMEOFDAY
2116 || _LIBC; otherwise, fall back on plain "time".
2117 Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
2118
2119 * lib/mkstemp.c (__GT_FILE): Define to zero if not defined.
2120
21212000-10-25 Paul Eggert <eggert@twinsun.com>
2122
2123 * lib/hard-locale.c: New file.
2124
21252000-02-05 Paul Eggert <eggert@twinsun.com>
2126
2127 * exgettext: From GCC repository
2128
21291999-07-06 Paul Eggert <eggert@twinsun.com>
2130
2131 * lib/mkstemp.c: glibc 2.2
2132
21331998-12-11 Paul Eggert <eggert@twinsun.com>
2134
2135 * src/sdiff.c (lf_snarf):
2136 Fix bug when help line wrapped around the input buffer.
2137
21381998-09-15 Paul Eggert <eggert@twinsun.com>
2139
2140 * diff.texi: Add @dircategory and @direntry.
2141
21421998-09-14 Paul Eggert <eggert@twinsun.com>
2143
2144 * Makefile.in (VERSION): Version 2.7.2.
2145 (DEFAULT_DIFF_PROGRAM): Renamed from DIFF_PROGRAM.
2146 (PR_PROGRAM): All `configure' to define it.
2147 (srcs): Add $(diffutils_srcs), freesoft.c, quotearg.c instead of
2148 quote.c, quotearg.h.
2149 (distfiles): Add acconfig.h, message/*.
2150 (all): Depend on $(destfiles), not info.
2151 (version.c): Parenthesize `GNU diffutils'.
2152 (common_o): Add freesoft.o
2153 (diff_o): quote.o -> quotearg.o
2154 (diff3_o, sdiff_o): Likewise.
2155 (diff.dvi): Depend on version.texi.
2156 (diff.o diff3.o quotearg.o sdiff.o util.o):
2157 New dependency on quotearg.h
2158 (diff3.o): DIFF_PROGRAM -> DEFAULT_DIFF_PROGRAM.
2159 (sdiff.o): Likewise.
2160 (messages.po): Remove.
2161 (message/msgid.po, message/template.po): New rules.
2162 (maintainer-clean): Renamed from realclean.
2163 (install): Install from source directory, if applicable.
2164 Invoke install-info if needed.
2165 (install-strip): New rule.
2166 (check): Set DIFF.
2167 (stamp-h.in): Don't put the date into the timestamp.
2168 (D_dirs): Add $D/message.
2169 ($D.tar.gz): Compress with gzip -9.
2170 Don't use ln to create distribution; it doesn't work with symlinks.
2171 (srcs, distfiles, diff_o, diff3_o, sdiff_o): Rename quotearg.c to
2172 quotesys.c and quotearg.h to quotesys.h.
2173
2174 * configure.in (AC_PATH_PROG): Add PR_PROGRAM.
2175 If available, prefer support for large files unless the user specified
2176 one of the CPPFLAGS, LDFLAGS, or LIBS variables.
2177 (AC_STRUCT_ST_RDEV): Add.
2178 (HAVE_ST_FSTYPE_STRING): Add.
2179 (--with-mvfs-stat-bug, --with-nfs-stat-bug): New options.
2180 (HAVE_MEMCHR): New macro.
2181 (AC_CHECK_FUNCS): Add sicprocmask.
2182
2183 * diff.h (XTERN): Renamed from EXTERN.
2184 (struct filedata): Remove dir_p arg.
2185 (struct comparison): New type.
2186 (diff_2_files, diff_dirs)" Ise ot/
2187 (error): Add printf attribute if applicable.
2188 (free_software_msgid): New decl.
2189 (pr_program): New decl.
2190 (fatal): Add noreturn attribute.
2191 (pfatal_with_name): Likewise.
2192
2193 * system.h (__attribute__): New macro.
2194 (getenv): Don't declare if HAVE_STDLIB_H.
2195 (CHAR_MAX): New macro.
2196 (<locale.h>): New include.
2197 (<locale.h>): Include before <libintl.h>.
2198 (could_be_mvfs_stat_bug, could_be_nfs_stat_bug,
2199 dev_may_have_duplicate_ino, same_special_file): New macros.
2200 (same_file): Use them.
2201
2202 * cmp.c (authorship_msgid): New var.
2203 (free_software_msgid): New decl.
2204 (error): Now has printf attribute.
2205 (try_help): Likewise.
2206 (long_options): Don't assume ASCII.
2207 (try_help): Now accepts operand arg.
2208 (main): Check for -1, not EOF, when calling getopt_long.
2209 Report --ignore-initial value when complaining about it.
2210 Output copyright and free software info with -v.
2211 Don't assume ASCII.
2212 Report last operand when one is missing.
2213 Report text of extra operand.
2214 Move block_read into cmpbuf.c.
2215
2216 * diff.c (authorship_msgid): New var.
2217 (quotesys.h): Include.
2218 (ck_atoi): Remove.
2219 (function_regexp_list, ignore_regexp_list): Now static.
2220 (binary_flag): Renamed from binary_I_O.
2221 (entire_new_file_flag, unidirectional_new_file_flag,
2222 print_file_same_flag): Now static.
2223 (numeric_arg): Renamed from ck_atoi.
2224 New argument specifying the argument type.
2225 (longopts, main): Don't assume ASCII.
2226 (longopts): Remove old aliases --file-label, --entire-new-file,
2227 --ascii, --print.
2228 (main): Check for -1, not EOF, when calling getopt_long.
2229 Use numeric_arg to report errors.
2230 Report error if -l specified but pagination is not supported.
2231 Report error if -S is specified twice with conflicting values.
2232 Have --version conform to the new GNU standards.
2233 Add new --from-file, --to-file, --inhibit-hun,-merge options.
2234 Make the horizon at least as large as the context.
2235 Add casts to pacify gcc -Wall.
2236 (try_help): Add operand arg.
2237 (option_help_msgid): Doc fix to match above.
2238 (usage): Indent option_help_msgid.
2239 (compare_files): Now takes struct comparison
2240 instead of two directory names and a depth.
2241 (NONEXISTENT, UNOPENED, ERRNO_ENCODE, ERRNO_DECODE):
2242 New macros.
2243 (DIR_P): New macro.
2244 Report error if fflush does.
2245
2246 * cmpbuf.c (block_read): Moved here from cmp.c.
2247
2248 * cmpbuf.h (block_read): New decl.
2249
2250 * io.c (cmpbuf.h): Include.
2251 (slurp): Check for arithmetic overflow when computing buffer size.
2252
2253 * dir.c (diff_dirs): Check for recursive directory loop.
2254 Arg is now struct comparison const *.
2255 (dir_loop): New function
2256
2257 * analyze.c (no_discards): Remove.
2258 (inhibit): Remove.
2259 (shift_boundaries): Don't inhibit. If inhibit_hunk_merge is nonzero,
2260 don't merge hunks.
2261 (briefly_report): Now returns 2 if trouble, CHANGES otherwise.
2262 (diff_2_files): Now takes struct comparison. If briefly_report reports
2263 trouble, pass it on to caller.
2264
2265 * side.c (print_half_line): Add brackets to pacify GCC -Wall.
2266
2267 * sdiff.c (quotesys.h): Include.
2268 (DIFF_PROGRAM, DEFAULT_EDITOR_PROGRAM): Remove.
2269 (free_software_msgid, editor_program, not_found): New vars.
2270 (diffbin, edbin): Remove.
2271 (editor_program): Renamed from edbin.
2272 (edit, interact): Now take extra string arg.
2273 (exiterr, fatal, perror_fatal, try_help): Add noreturn attribute.
2274 (sigset_t, sigemptyset, sigmask, sigaddset, SIG_BLOCK, SIG_SETMASK):
2275 (sigprocmask): New macros, if !HAVE_SIGPROCMASK.
2276 (error): Now has printf attribute.
2277 (longopts, main): Don't assume ASCII.
2278 (try_help): New operand arg.
2279 (usage): Conform to new GNU standards.
2280 (main): Set static vars for editor and diff program.
2281 Compare getopt_long result to -1, not EOF.
2282 -v conforms to new GNU standard.
2283 Complain better about extra and missing operands.
2284 If HAVE_VFORK, block SIGINT and SIGPIPE in the parent, since when
2285 the child munges its handlers it may somp on the parent.
2286 Pass rname to intract.
2287 Translate not-found message before forking.
2288 (give_help): Just output it all at once.
2289 (edit): New args lname, lline, rname, rline.
2290 (edit): New command 'd'.
2291 (interact): New args lname, rname.
2292
2293 * util.c (quotesys.h): Include.
2294 (PR_PROGRAM): New macro.
2295 (pfatal_with_name): Abort if error returns.
2296 (fatal): Likewise.
2297 (print_message_queue): Free message chain after printing.
2298 (currently_recursive): Renamed from current_depth, and now a boolean.
2299 (begin_output): Report error if fflush does.
2300 Avoid stdio and gettext in child.
2301
2302 * diff3.c (quotesys.h): Include.
2303 (free_software_msgid): New decl.
2304 (RANGE_START, RANGE_END): Renamed from START and END.
2305 (fatal, perror_with_exit, try_help): Add noreturn attribute.
2306 (error): Add printf attribute.
2307 (diff_program): Now a ptr, not an array.
2308 Initialize to DEFAULT_DIFF_PROGRAM instead of DIFF_PROGRAM.
2309 (longopts, main): Don't assume ASCII.
2310 (main): Use DIFF environment var to specify name of diff program.
2311 Compare getopt_long result to -1, not EOF.
2312 -v now reports version according to new GNU standard.
2313 Report spelling of extra operand, or last operand before missing one.
2314 (try_help): Now takes operand arg.
2315 (option_help_ms): Fix typo: missing comma.
2316 (usage): Update as per current GNU standards.
2317 (environ): Remove decl.
2318 (read_diff): Invoke diff with --inhibit-hunk-merge.
2319 Translate `not found' message before forking.
2320 Quote name of diff program.
2321 Pass horizon lines.
2322 `memory exhausted' -> `Memory exhausted'
2323
2324 * pc/makefile (%.exe): Remove.
2325 (pc-clean): Remove *.exe
2326 * pc/makefile.sed (DEFAULT_DIFF_PROGRAM): Renamed from DIFF_PROGRAM.
2327 When editing mkinstalldirs rule, look for exec_prefix and prefix.
2328 Add .exe when installing files.
2329 * pc/emx/config.h (same_file): Add.
2330 * pc/config.h (same_file): Remove.
2331 * pc/djgpp/config.h: Adjust to latest patch from eliz.
2332 * pc/djgpp/makefile.sed: Don't alter PROGRAMS.
2333 * pc/pc.c: Update FSF address.
2334 (quote_system_arg): Renamed from system_quote_arg.
2335
2336 * README: Add --with-mvfs-stat-bug, --with-nfs-stat-bug.
2337
2338 * getmsgids: Add copyright date and update FSF address.
2339
2340 * diff.texi: Document recent changes.
2341 The patch doc still corresponds to patch 2.2, unfortunately.
2342 Update GNU bug reporting address. Omit Larry Wall's address;
2343 it's obsolete and he's busy with perl.
2344
2345 * context.c: Fix spacing.
2346
2347 * NEWS: Mention --from-file=FILE, --to-file=FILE, ed.
2348
2349 * acconfig.h, freesoft.c, message/de.po, message/en_UK.po,
2350 message/es.po, message/fr.po, message/pl.po, message/sv.po:
2351 New files.
2352
2353 * ed.c: Remove `#if 0'ed code.
2354
2355 * normal.c, waitpid.c: Update FSF address.
2356
23571998-03-15 Paul Eggert <eggert@twinsun.com>
2358
2359 * quotesys.c: Renamed from quotearg.c.
2360
2361 * quotesys.h: Renamed from quotearg.h
2362 (__QUOTESYS_P): Renamed from __QUOTEARG_P.
2363
23641997-05-05 Paul Eggert <eggert@twinsun.com>
2365
2366 * quotesys.c, quotesys.h: New file.
2367
2368Mon Nov 14 05:10:56 1994 Paul Eggert <eggert@twinsun.com>
2369
2370 Add internationalization support.
2371 Several messages have been changed slightly,
2372 to make them more consistent and easier to translate.
2373 All strings that are messages are passed through gettext once before
2374 being used, so that they can be localized.
2375 Each function and macro whose first parameter is a gettext msgid
2376 has had its first parameter's name changed so it ends in `msgid'.
2377 All arrays of msgids have had their names changed to end in `msgid'.
2378 `getmsgids' uses this to determine which strings are msgids.
2379
2380 * pc/COPYING, pc/INSTALL, pc/config.h,
2381 pc/djgpp/config.h, pc/djgpp/makefile.sed,
2382 pc/emx/config.h, pc/emx/diff.def, pc/emx/gnuregex.def,
2383 pc/emx/makefile.sed,
2384 pc/makefile, pc/makefile.sed, pc/pc.c: New files, for PC support.
2385
2386 * getmsgids: New file.
2387
2388 * Makefile.in (PACKAGE, VERSION, diffutils_srcs, D): New vars.
2389 (version.c, version.texi, messages.po): New files.
2390 messages.po is built automatically from source files and `getmsgids'.
2391 (distfiles): Add them, pc/*, and getmsgids.
2392 (diff.info): Now depends on version.texi.
2393 (realclean): Clean messages.po, version.*.
2394 (dist): Just build $D.tar.gz.
2395 ($D.tar.gz): New file, takes over old `dist' function.
2396 Don't assume $(distfiles) are all in same directory.
2397
2398 * configure.in (AC_CHECK_HEADERS): Add libintl.h, locale.h.
2399 (AC_CHECK_LIB): Check for -lintl.
2400
2401 * analyze.c (briefly_report): Rewrite `message (A?"B":"C")' as
2402 `if (A) message ("B") : message ("C")'; this is for getmsgids.
2403 (briefly_report, diff_2_files): For label, use file_label if set.
2404 * diff.c (compare_files): Likewise.
2405
2406 * system.h (gettext): Declare; use a stub if ! HAVE_LIBINTL_H.
2407 (setlocale): Declare; use a stub if ! HAVE_LOCALE_H.
2408
2409 * cmp.c, diff.c, diff3.c, sdiff.c (main):
2410 Invoke setlocale first thing, to tell library we're internationalized.
2411 (option_help_msgid): New constant.
2412 (usage): Use it, so message is translated one option at a time.
2413 * sdiff (help_msgid, give_help): Likewise.
2414
2415 * cmp.c (sprintc): Renamed from `printc'.
2416 Now outputs to a buffer instead of stdout.
2417 (cmp): Use new sprintc; it's easier to internationalize.
2418
2419 * diff.c (main): -D FOO now outputs `/* ! FOO */ instead of
2420 `/* not FOO */'.
2421
2422 * sdiff.c (version_string): Fix decl typo: `const' was missing.
2423 (trapsigs): Ignore sigaction failure, to be compatible with `signal'.
2424
2425 * util.c (struct msg, message5, print_message_queue):
2426 Allocate just one block of memory to save a message.
2427
2428Wed Nov 9 17:42:44 1994 Paul Eggert <eggert@twinsun.com>
2429
2430 * sdiff.c (trapsigs): Don't check signal return value, since it's
2431 bogus under djgpp.
2432
2433Mon Oct 31 07:27:27 1994 Paul Eggert <eggert@twinsun.com>
2434
2435 * Makefile.in (srcs, diff_o, diff3_o, sdiff_o):
2436 New files quote.c, quote.o.
2437
2438 * diff.h (function_regexp, ignore_regexp): Replace lists of compiled
2439 regexps with these single compiled regexps. All users changed.
2440 (regexp_list,function_regexp_list,ignore_regexp_list): Move to diff.c.
2441 * diff.c (add_regexp): Build one big regexp instead of a regexp list.
2442 (summarize_regexp_list): New function.
2443 (regexp_list): Redesigned struct; moved here from diff.h.
2444 (function_regexp_list, ignore_regexp_list): Likewise, for vars.
2445
2446 * context.c (find_function): Simplify interface:
2447 don't return size of function line. All callers changed.
2448 (print_context_script, find_function): INT_MAX now denotes no
2449 previous match; this is simpler than `- file->prefix_lines - 1'.
2450
2451 * diff3.c (read_diff): Quote arguments with system_quote_arg.
2452 * sdiff.c (main): Use system_quote_arg to compute command.
2453 * diff.c (option_list): Quote options with system_quote_arg.
2454 * util.c (begin_output): Use system_quote_arg to compute command.
2455
2456 * util.c (pr_program): New var.
2457 (analyze_hunk): Fix off-by-1 line length bug.
2458 Match with one big regexp instead of a list of regexps.
2459 Use new `trivial_length' local instead of comparing first byte to `\n'.
2460 Help the compiler with linbuf local vars.
2461
2462 * system.h (system_quote_arg):
2463 New function; replaces SYSTEM_QUOTE_ARG macro.
2464
2465Sat Oct 15 20:09:12 1994 Paul Eggert <eggert@twinsun.com>
2466
2467 * system.h (_tolower): Define if not already defined.
2468 * io.c (find_and_hash_each_line): Change tolower to _tolower; this
2469 speeds up diff -i considerably on some hosts (e.g. Solaris 2.3).
2470 * util.c (line_cmp): Likewise.
2471 * ifdef.c (groups_letter_value): Likewise.
2472
2473 * diff.h (ignore_some_line_changes): Remove. All users changed.
2474 * io.c (find_and_hash_each_line): Don't invoke line_cmp if the length
2475 differs and -i is in force. Don't assume ISSPACE ('\n') is nonzero.
2476
2477 * diff.h (xmalloc_exit_failure): New variable.
2478 All `main' programs set this variable at the start.
2479 xmalloc and xrealloc are now taken from GNU library.
2480 * cmp.c (main): Align buffer size to word size; some mallocs care.
2481 * io.c (slurp): Likewise.
2482 * diff.c (add_exclude): Can now assume xrealloc (0, ...) works.
2483 (add_regexp): Free storage on failure. Allocate storage all at one go.
2484 * system.h (malloc, realloc): Remove unused declarations.
2485 * diff3.c, sdiff.c, util.c (xmalloc, xrealloc): Remove.
2486 * sdiff.c (diffarg): Take advantage of cleaner xrealloc semantics.
2487
2488 * io.c (ROL): Use sizeof to make it more generic.
2489
2490 * Makefile.in (common_o): New variable.
2491 Link error.o and xmalloc.o into all programs.
2492 (check): Depend on $(PROGRAMS).
2493
2494 * diff.h (error): Change to GNU library standard. All callers changed.
2495 * diff3.c (main): Use strerror (EISDIR) instead of "Is a directory".
2496 (fatal, perror_with_exit): Use `error'.
2497 * util.c (perror_with_name, fatal): Use GNU `error'.
2498 (error): Remove.
2499
2500Wed Oct 12 17:04:40 1994 David J. MacKenzie (djm@duality.gnu.ai.mit.edu)
2501
2502 * cmp.c (main): Set xmalloc_exit_failure.
2503
2504Sat Oct 1 05:24:19 1994 Paul Eggert <eggert@twinsun.com>
2505
2506 * Version 2.7 released.
2507
2508 * configure.in (AC_HEADER_SYS_WAIT): Add.
2509 (AC_CHECK_HEADERS): Remove sys/wait.h.
2510 (AC_CHECK_FUNCS): Add tmpnam.
2511 * system.h (<sys/wait.h>, WEXITSTATUS): Use simpler scheme
2512 now that HAVE_SYS_WAIT_H is not set on hosts
2513 that are incompatible with Posix applications.
2514
2515 * util.c (dir_file_pathname): Use filename_lastdirchar not strrchr.
2516 * sdiff.c (expand_name): Likewise.
2517 (private_tempnam): Use tmpnam if HAVE_TMPNAM; this simplifies porting.
2518 (exists, letters): Omit if HAVE_TMPNAM.
2519
2520 * diff3.c (read_diff): If STAT_BLOCKSIZE yields zero,
2521 adjust it to a more reasonable value.
2522
2523Sat Sep 24 20:36:40 1994 Paul Eggert <eggert@twinsun.com>
2524
2525 * sdiff.c (exists, private_tempname): Adopt latest GNU libc algorithm.
2526 (private_tempnam): Specialize for sdiff to avoid portability problems.
2527
2528Thu Sep 22 16:47:00 1994 Paul Eggert <eggert@twinsun.com>
2529
2530 * configure.in (AC_ARG_PROGRAM): Added.
2531 (AC_OUTPUT): Add [date > stamp-h].
2532
2533 * Makefile.in (DEFAULT_EDITOR_PROGRAM, DIFF_PROGRAM, LIBOBJS,
2534 NULL_DEVICE, PR_PROGRAM, PROGRAMS): New variables.
2535 (check, stamp-h.in, cmp.o, util.o): New targets.
2536 (edit_program_name): New variable; replaces old binprefix method.
2537 (install, uninstall): Use it.
2538 (binprefix): Removed.
2539 (distfiles): Add stamp-h.in.
2540 (clean): Clean stamp-h.
2541 (config.hin, config.h): Use time stamp files.
2542 (cmp_o): Add $(LIBOBJS).
2543 (install): Install info files from srcdir if they're not in `.'.
2544
2545 * cmp.c, io.c (word): Don't define if already defined.
2546
2547 * comp.c (main): Use setmode, not open(..., O_BINARY); this gets stdin.
2548 Use NULL_DEVICE instead of "/dev/null".
2549 (cmp): Use %lu instead of %ld when it is more likely to be right.
2550
2551 * diff.h (PR_FILE_NAME): Rename to PR_PROGRAM and move to Makefile.in,
2552 util.c.
2553
2554 * diff3.c (main): Give proper diagnostic if too many labels were given.
2555 (read_diff): Use SYSTEM_QUOTE_ARG.
2556
2557 * system.h: <string.h>: Include if HAVE_STRING_H, too.
2558 <ctype.h>: Include here. All includers changed.
2559 (CTYPE_DOMAIN, ISDIGIT, ISPRINT, ISSPACE, ISUPPER): New macros that
2560 work around common <ctype.h> problems.
2561 (O_BINARY): Remove.
2562 (SYSTEM_QUOTE_ARG): New macros.
2563
2564 * diff.c: Add comment.
2565
2566 * util.c (PR_PROGRAM): Moved here from diff.h.
2567 (begin_output): Use SYSTEM_QUOTE_ARG.
2568
2569 * io.c (read_files): Set mode to binary before returning 1.
2570
2571 * sdiff.c (TMPDIR_ENV): New macro.
2572 (DEFAULT_EDITOR_PROGRAM): Renamed from DEFAULT_EDITOR for consistency.
2573 (expand_name): Change `isdir' to `is_dir' to avoid theoretical ctype
2574 namespace contamination.
2575 (main): Use SYSTEM_QUOTE_ARG.
2576 (private_tempnam): Don't access "/tmp" directly; use PVT_tmpdir.
2577
2578Tue Sep 13 18:46:43 1994 Paul Eggert <eggert@twinsun.com>
2579
2580 * configure.in (AC_FUNC_MEMCHR): Remove. Autoconf didn't adopt this,
2581 since we need not worry about an old experimental library
2582 where memchr didn't work.
2583 (AC_FUNC_MEMCMP): Not needed, since we only test for equality.
2584 (AC_REPLACE_FUNCS): Add test for memchr.
2585 (AC_CHECK_FUNCS): Check for memchr, not memcpy, since it'll be cached.
2586 (AC_CHECK_HEADERS): Add string.h; regex.c uses on some old hosts.
2587
2588 * system.h (memcmp): Define in terms of bcmp.
2589 Use HAVE_MEMCHR to test for all mem* routines.
2590
2591 * Makefile.in (srcs): Remove memcmp.c.
2592 We use bcmp if memcmp doesn't work, since we only test for equality.
2593
2594Mon Sep 12 15:52:22 1994 Paul Eggert <eggert@twinsun.com>
2595
2596 * configure.in (AC_CONFIG_HEADER): Rename config.h.in to config.hin.
2597 (AC_ISC_POSIX, AC_MINIX): Go back to these old names for Autoconf 2.
2598 (AC_CHECK_HEADERS): Remove now-redundant check for <string.h>.
2599 (AC_CHECK_FUNCS): Check for strchr.
2600 (AC_FUNC_MEMCHR, AC_FUNC_MEMCMP, AC_CHECK_FUNCS): Use special-purpose
2601 macros when suitable.
2602 * memcmp.c: New file.
2603 * Makefile.in (CPPFLAGS, DEFS, CFLAGS, LDFLAGS, prefix, exec_prefix):
2604 Default to autoconf-specified strings.
2605 (COMPILE): Use the defaults.
2606 (srcs): Add memcmp.c.
2607 (distfiles): Rename config.h.in->config.hin, install.sh->install-sh.
2608 (Makefile, config.h, config.hin, config.status): Rework for
2609 compatibility with Autoconf 2.
2610 * io.c (binary_file_p): Assume non-broken memchr.
2611 * memchr.c: Assume compiler understands void *; otherwise
2612 we don't match GCC's internal declaration of memchr.
2613 * system.h: Use more modern autoconf approach to standard C headers.
2614 * version.c: Include <config.h>, not "config.h".
2615
2616 * diff.c, diff.h (ignore_some_line_changes):
2617 New variable; replaces `length_varies'.
2618 (line_end_char): Replace with '\n'; it wasn't being used consistently.
2619
2620 * io.c (find_and_hash_each_line): Fix inconsistencies with -b -w -i and
2621 incomplete lines. Put incomplete lines into their own bucket.
2622 This means line_cmp no longer needs line length arguments,
2623 and equivalence classes' line lengths no longer need to include \n.
2624 Invoke line_cmp only if ignore_some_line_changes.
2625 (prepare_text_end): -B no longer ignores missing newlines.
2626 (read_files): Allocate another bucket for incomplete lines.
2627
2628 * util.c (line_cmp): Now takes just two arguments. No longer
2629 optimizes for common case of exact equality; the caller does that
2630 optimization now. The caller is changed accordingly.
2631 Optimize for the common case of mostly equality.
2632 Use isupper+tolower instead of islower+toupper, for consistency.
2633
2634 * waitpid.c (waitpid): Fix typo with internal scoping.
2635
2636Thu Sep 8 08:23:15 1994 Paul Eggert <eggert@twinsun.com>
2637
2638 * configure.in: Revamp for Autoconf 2.
2639 * memchr.c, waitpid.c: New source files for substitute functions.
2640 * Makefile.in (diff_o, diff3_o, sdiff_o): Add $(LIBOBJS).
2641 (srcs): Add memchr.c, waitpid.c.
2642 (distfiles): Add install.sh, memchr.c, waitpid.c, install.sh.
2643 * system.h: Use Autoconf 2 style HAVE_DIRENT_H etc. macros for dirs.
2644 * dir.c (dir_sort): Prefer NAMLEN (p) to strlen (p->d_name).
2645 Change VOID_CLOSEDIR to CLOSEDIR_VOID for Autoconf 2.
2646 * sdiff.c, util.c (memchr, waitpid): Remove; use new substitutes.
2647 * diff3.c (read_diff): Use new waitpid substitute.
2648
2649 * cmp.c, diff.c, diff3.c, sdiff.c (check_stdout, try_help): New fns.
2650 (usage): Just print more detailed usage message; let caller exit.
2651 * diff.c (option_help): New variable.
2652 (filetype): Add Posix.1b file types.
2653
2654Fri Sep 2 16:01:49 1994 Paul Eggert <eggert@twinsun.com>
2655
2656 * configure.in: Switch to new autoconf names. Add sys/file.h test.
2657 * Makefile.in (distclean): Clean config.cache, config.log
2658 (used by new autoconf).
2659
2660 * diff.c, diff3.c, (main), sdiff.c (trapsigs): If we'll have children,
2661 make sure SIGCHLD isn't ignored.
2662
2663 * diff3.c (DIFF_CHUNK_SIZE): Removed. Get size from STAT_BLOCKSIZE.
2664 (INT_STRLEN_BOUND): New macro.
2665
2666 * ifdef.c (format_group, groups_letter_value):
2667 Use * instead of [] in prototypes.
2668
2669 * system.h: Include <sys/file.h> only if HAVE_SYS_FILE_H.
2670 (S_IXGRP, S_IXOTH, S_IXUSR): Remove unused macros.
2671
2672 * util.c (begin_output): Check fdopen result.
2673
2674 The following changes simplify porting to non-Posix environments.
2675 * cmp.c, diff.c, diff3.c, sdiff.c, (main): Call initialize_main first.
2676 * diff.c (binary_I_O): New variable for --binary option.
2677 (main, usage, compare_files): Support --binary option.
2678 (compare_files): Use filename_lastdirchar to find last
2679 directory char in a file name.
2680 * cmp.c (main), diff.c (compare_files), dir.c (compare_names,
2681 diff_dirs): Use filename_cmp to compare file names.
2682 Use same_file to determine whether two files are the same.
2683 * context.c (print_context_label): Check whether ctime yields 0.
2684 * diff3.c (read_diff), sdiff.c (cleanup, main, waitpid),
2685 util.c (begin_output): Use popen+pclose if !HAVE_FORK.
2686 * io.c (sip): If HAVE_SETMODE, test for binary files in O_BINARY mode.
2687 * sdiff.c (ck_fdopen): Function removed.
2688 (edit): Use system if !HAVE_FORK.
2689 (execdiff): Now assumes caller has pushed all args, plus trailing 0.
2690 All callers changed.
2691 (private_tempnam): Try TMP if TMPDIR isn't defined.
2692 Fit temporary filenames into 8.3 limit.
2693 * system.h (STAT_BLOCKSIZE): Don't define if already defined.
2694 (min, max): Undef if already defined.
2695 (filename_cmp, filename_lastdirchar, HAVE_FORK, HAVE_SETMODE,
2696 initialize_main, O_BINARY, same_file): New macros.
2697
2698Fri Jun 17 11:23:53 1994 David J. MacKenzie (djm@geech.gnu.ai.mit.edu)
2699
2700 * Makefile.in (info, dvi, diff.dvi): New targets.
2701 (clean): Remove TeX output files.
2702
2703Fri Jun 17 05:37:52 1994 Paul Eggert (eggert@twinsun.com)
2704
2705 * cmp.c, io.c (word): Change from typedef to #define, to avoid
2706 collision with Unicos 8.0 <sys/types.h>, which also typedefs `word'.
2707
2708Thu Apr 15 00:53:01 1994 Paul Eggert (eggert@twinsun.com)
2709
2710 * diff3.c (scan_diff_line), util.c (print_number_range): Don't
2711 rely on promotion to make the old-style parameter type agree
2712 with the prototype parameter type; this doesn't work on
2713 Apollos running bsd4.3.
2714
2715Mon Jan 3 02:05:51 1994 Paul Eggert (eggert@twinsun.com)
2716
2717 * Makefile.in (LDFLAGS): Remove -g. Change all link commands
2718 to use both $(CFLAGS) and $(LDFLAGS).
2719
2720Mon Dec 13 12:23:27 1993 Paul Eggert (eggert@twinsun.com)
2721
2722 * system.h: Don't assume dirent.h exists just because
2723 _POSIX_VERSION is defined.
2724
2725Fri Dec 3 18:39:39 1993 Paul Eggert (eggert@twinsun.com)
2726
2727 * diff.c (main): allow -pu.
2728
2729Tue Nov 23 03:51:08 1993 Paul Eggert (eggert@twinsun.com)
2730
2731 * Makefile.in (distclean): Remove config.h.
2732
2733Wed Nov 10 00:28:27 1993 Paul Eggert (eggert@twinsun.com)
2734
2735 * Version 2.6 released.
2736
2737 * analyze.c (too_expensive): New variable, for heuristic to
2738 limit the worst-case cost to O(N**1.5 log N) at the price of
2739 producing suboptimal output for large inputs with many differences.
2740 (diff_2_files): Initialize it.
2741 (struct partition): New type.
2742 (SNAKE_LIMIT): New macro; merely documents already-used number 20.
2743 (diag): New `minimal' arg; all callers changed. Put results into
2744 struct partition. Apply `too_expensive' heuristic. Tune.
2745 (compareseq): New `minimal' arg; all callers changed. Tune.
2746 (shift_boundaries): Improve heuristic to also coalesce adjacent runs
2747 of changes more often.
2748
2749 * diff.c (long_options, main, usage): Add `--help'.
2750 (main): Send version number to stdout, not stderr.
2751 (usage): Send usage to stdout, not stderr.
2752 (compare_files): Initialize `inf' properly.
2753
2754 * io.c (word): Change to `int'; it makes a big difference on x86.
2755 (sip, slurp): Put off allocating room to hold the whole file until we
2756 have to read the whole file. This wins if the file turns out
2757 to be binary.
2758
2759 * util.c (xmalloc, xrealloc): "virtual memory" -> "memory"
2760 (primes): Omit large primes if INT_MAX is small.
2761
2762 * sdiff.c (usage): Send usage to stdout, not stderr.
2763 (long_options, main, usage): Add `--help'.
2764 (main): Send version number to stdout, not stderr. Exit afterwards.
2765
2766 * diff3.c (usage): Send usage to stdout, not stderr.
2767 (long_options, main, usage): Add `--help'.
2768 (read_diff): Detect integer overflow in buffer size calculations.
2769
2770 * cmp.c (word): New type. All uses of `long' for
2771 word-at-a-time comparisons changed to `word'.
2772 (long_options, main, usage): Add `--help'.
2773 (usage): Send usage to stdout, not stderr.
2774 (main): Add `-v'. Send version number to stdout, not stderr.
2775
2776 * configure.in (AC_HAVE_HEADERS): Add unistd.h; remove AC_UNISTD_H.
2777
2778Mon Sep 27 07:20:24 1993 Paul Eggert (eggert@twinsun.com)
2779
2780 * diff.c (add_exclude_file): Cast memchr to (char *)
2781 to suppress bogus warnings on some nonstandard hosts.
2782
2783 * Makefile.in (cmp): Add version.o.
2784
2785 * analyze.c (diff_2_files): Work around memcmp bug with size=0.
2786
2787 * cmp.c (main, usage, version_string): Add --version option.
2788
2789 * system.h (malloc, realloc): Declare only if !HAVE_STDLIB_H.
2790 (memchr): Declare only if !HAVE_MEMCHR. These changes are
2791 needed to keep some nonstandard hosts happy.
2792
2793 * util.c (memchr): Make first arg char const *
2794 to match standard.
2795 (xmalloc, xrealloc): Cast malloc, realloc
2796 to (VOID *) to suppress bogus warnings on some nonstandard hosts.
2797
2798 * diff3.c (xmalloc, xrealloc): Cast malloc, realloc
2799 to (VOID *) to suppress bogus warnings on some nonstandard hosts.
2800
2801 * sdiff.c (xmalloc, xrealloc): Cast malloc, realloc
2802 to (VOID *) to suppress bogus warnings on some nonstandard hosts.
2803 (lf_copy, lf_skip, lf_snarf): Cast memchr to (char *)
2804 to suppress bogus warnings on some nonstandard hosts.
2805 (memchr): Make first arg char const *
2806 to match standard.
2807
2808Mon Sep 27 00:23:37 1993 Paul Eggert (eggert@twinsun.com)
2809
2810 * Version 2.5 released.
2811
2812 * analyze.c (diff_2_files): Work around memcmp bug with size=0.
2813
2814 * cmp.c (main, usage, version_string): Add --version option.
2815 * Makefile.in (cmp): Add version.o.
2816
2817 * diff.c (add_exclude_file): Cast memchr to (char *)
2818 to suppress bogus warnings on some nonstandard hosts.
2819 * sdiff.c (lf_copy, lf_skip, lf_snarf): Likewise.
2820
2821 * diff3.c, sdiff.c, util.c (xmalloc, xrealloc): Cast malloc, realloc
2822 to (VOID *) to suppress bogus warnings on some nonstandard hosts.
2823
2824 * sdiff.c, util.c (memchr): Make first arg char const *
2825 to match standard.
2826
2827 * system.h (malloc, realloc): Declare only if !HAVE_STDLIB_H.
2828 (memchr): Declare only if !HAVE_MEMCHR. These changes are
2829 needed to keep some nonstandard hosts happy.
2830
2831 * xmalloc.c: Include <sys/types.h> always; some nonstandard hosts
2832 need it for size_t even if STDC_HEADERS.
2833
2834Sat Sep 18 01:33:07 1993 Paul Eggert (eggert@twinsun.com)
2835
2836 * configure.in (AC_STAT_MACROS_BROKEN): Add.
2837 * system.h (S_IS{BLK,CHR,DIR,FIFO,REG,SOCK}): Fix defns if
2838 STAT_MACROS_BROKEN.
2839
2840 * Makefile.in (diff3, sdiff, cmp): Do not link $(ALLOCA).
2841
2842 * analyze.c (discard_confusing_lines): Make defn static, like decl.
2843 * sdiff.c (xmalloc): Likewise.
2844
2845 * ifdef.c (format_group): Ensure isdigit argument isn't < 0.
2846
2847 * side.c (print_half_line): Use isprint, since some hosts lack isgraph.
2848 * util.c (output_1_line): Likewise. Ensure its argument isn't < 0.
2849 (xmalloc, xrealloc): Remove needless casts.
2850
2851 * system.h (volatile, const):
2852 Define these before including any system headers,
2853 so that they're used consistently in all system includes.
2854 (getenv, malloc, realloc): Declare even if HAVE_STDLIB_H, since some
2855 <stdlib.h>s don't declare them.
2856 (memchr): Likewise for <string.h>.
2857
2858 * cmp.c, diff3.c, diff.h, sdiff.c: Include "system.h" first.
2859 * diff.c: Remove redundant "system.h" inclusion.
2860
2861 * diff3.c (xmalloc): Now static.
2862 (xmalloc, realloc): Remove needless casts.
2863 (READNUM): Ensure isdigit argument isn't negative.
2864
2865Wed Sep 14 07:14:15 1993 Paul Eggert (eggert@twinsun.com)
2866
2867 * Version 2.4 released.
2868
2869 * ifdef.c (scan_char_literal): New function, for new %c'x' and
2870 %c'\ooo' format specs.
2871 (format_group, print_ifdef_lines): Use it. Remove %0 format spec.
2872
2873 * cmp.c (cmp): Don't try to read past end of file; this doesn't
2874 work on ttys.
2875
2876 * system.h, version.c: #include <config.h>, not "config.h", to allow
2877 configuring in a separate directory when the source directory has
2878 already been configured.
2879 * Makefile.in (COMPILE): New defn, with proper -I options so that
2880 `#include <config.h>' works.
2881 (.c.o, diff3.o, sdiff.o): Use it.
2882
2883Mon Sep 13 06:45:43 1993 Paul Eggert (eggert@twinsun.com)
2884
2885 * diff.c (main, longopts): Add --line-format=FORMAT option.
2886 (specify_format): Args no longer const pointers. All callers changed.
2887
2888 * ifdef.c: Add support for %?c, %(A=B?T:E), PRINTF_SPECn formats.
2889 (struct group): New struct.
2890 (print_ifdef_lines): Use it to simplify argument passing.
2891 Remove the convention that last arg -1 signifies that the lines
2892 from file 2 are the same as the lines from file 1; this
2893 convention no longer works, now that line numbers might be
2894 printed out, since the line numbers may differ.
2895 Add first FILE * argument to output to. All callers changed.
2896 Use a faster test for the single-fwrite optimization.
2897 (format_group, scan_printf_spec, groups_letter_value): New functions.
2898
2899 * diff.h (group_format, line_format): No longer const pointers.
2900 (format_ifdef): 1st arg is no longer const pointer.
2901
2902 * configure.in: Configure HAVE_LIMITS_H, HAVE_STDLIB_H.
2903 * system.h <limits.h>, <stdlib.h>, <string.h>:
2904 Include only if HAVE_LIMITS_H etc.
2905
2906 * system.h (memcmp, memcpy, strchr, strrchr, struct dirent): Prefer
2907 these standard names to the traditional names (bcmp, bcpy, index,
2908 rindex, struct direct). All callers changed.
2909
2910 * system.h (PARAMS, VOID):
2911 Define earlier so that malloc decl can use VOID.
2912 (STAT_BLOCKSIZE): Simplify ersatz defn; just use 8K.
2913
2914Fri Sep 3 00:21:02 1993 Paul Eggert (eggert@twinsun.com)
2915
2916 * diff.c (compare_files): Two files with the same name must be
2917 the same file; avoid a needless `stat' in that case.
2918
2919Fri Aug 27 06:59:03 1993 Paul Eggert (eggert@twinsun.com)
2920
2921 * Pervasive changes for portability to 64-bit hosts:
2922 Add prototypes to function declarations.
2923 Use size_t, not int, when needed.
2924
2925 * Other pervasive changes:
2926 Use `const' more often.
2927 Use STD{IN,OUT,ERR}_FILENO instead of [012].
2928 Use 0, not NULL, for portability to broken hosts.
2929
2930 * Makefile.in: (srcs, objs, distfiles, cmp): New files cmpbuf.[ch].
2931 (distfiles): New files config.h.in, mkinstalldirs.
2932 (.c.o): Add -DHAVE_CONFIG_H.
2933
2934 * analyze.c: (diag): Pacify `gcc -Wall' with a useless assignment.
2935 (diff_2_files): Use l.c.m., not max, of files' buffer sizes.
2936
2937 * cmp.c: Make globals static when possible.
2938
2939 (file): Now a 2-element array; replaces `file1' and `file2'.
2940 (file_desc, buffer): Likewise, for file[12]_desc and buf[12].
2941 (main): Likewise, for stat_buf[12]. Index these variables with `i'.
2942
2943 (ignore_initial): New var.
2944 (long_options): Now const. Add `--ignore-initial'.
2945 (usage): Sort options and add `--ignore-initial'.
2946 (main, cmp): Add `--ignore-initial' support.
2947
2948 (main): `cmp - -' now succeeds.
2949 When comparing standard input to a file, and using a shortcut (e.g.
2950 looking at file sizes or inode numbers), take the lseek offset into
2951 account before deciding whether the files are identical.
2952 Avoid mentioning `dev_t', `ino_t' for portability to nonstandard hosts.
2953 Use l.c.m. of files' buffer sizes, not 8 * 1024.
2954 ferror (stdout) does not imply errno has a useful value.
2955 If 2nd file is "-", treat it first, in case stdin is closed.
2956
2957 (cmp): Always compute `char_number', `smaller' for speed and simplicity.
2958 Say `cmp: EOF on input', not `/usr/gnu/bin/cmp: EOF on input',
2959 as per Posix.2.
2960
2961 (block_compare_and_count): Increment line_number argument.
2962 Remove end_char argument; it's always '\n'. All callers changed.
2963 Do not assume sizeof(long) == 4; this isn't true on some 64-bit hosts.
2964 (block_compare): Minimize differences with block_compare_and_count.
2965
2966 (block_read): Coalesce `bp += nread's.
2967
2968 (printc): Remove `FILE *' arg; output to stdout. All callers changed.
2969
2970 * configure.in: Configure HAVE_SIGACTION, RETSIGTYPE, HAVE_VPRINTF.
2971 Configure into config.h.
2972
2973 * context.c (print_context_label):
2974 Standard input's st_mtime is no longer a special case
2975 here, since `compare_files' now sets it to the current time.
2976
2977 * diff.c (usage): Sort options.
2978 (filetype): New function.
2979 (compare_files): Set stdin's st_mtime to be the current time.
2980 Leave its name "-" instead of changing it to "Standard Input";
2981 to test whether a file is stdin, we must compare its name to "-" instead
2982 of its desc to 0, since if it's closed other file descs may be 0.
2983 When comparing standard input to a file, and using a shortcut (e.g.
2984 looking at file sizes or inode numbers), take the lseek offset into
2985 account before deciding whether the files are identical.
2986 Pretend that nonexistent files have the same filetype as existing files.
2987 Rename `errorcount' to `failed', since it's boolean.
2988 In directory comparisons, if a file is neither a regular file nor a
2989 directory, just print its type and the other file's type.
2990
2991 * diff.h (Is_space, textchar): Remove.
2992 (struct msg, msg_chain, msg_chain_end): Move to util.c.
2993 (VOID): Move to system.h.
2994 (line_cmp, version_string, change_letter, print_number_range,
2995 find_change): New decls.
2996
2997 * diff.texi:
2998 whitespace -> white space. It now stands for whatever isspace yields.
2999 Add --ignore-initial.
3000
3001 * diff3.c (VOID): Move to system.h.
3002 (version_string): Now char[].
3003 (usage): Sort options.
3004 (process_diff): Pacify `gcc -Wall' with a useless assignment.
3005 (read_diff): pid is of type pid_t, not int. Use waitpid if available.
3006 (output_diff3): Simplify test for `\ No newline at end of file' message.
3007
3008 * dir.c (struct dirdata): Rename `files' to `names' to avoid confusion
3009 with external struct file_data `files'.
3010
3011 * io.c (line_cmp): Move declaration to diff.h.
3012 (textchar): Remove.
3013 (find_and_hash_each_line): Use locale's definition of white space
3014 instead of using one hardwired defn for -b and another for -w.
3015
3016 * normal.c (change_letter, print_number_range, find_change):
3017 Move decls to diff.h.
3018 (print_normal_hunk): Now static.
3019
3020 * sdiff.c (SEEK_SET): Move to system.h.
3021 (version_string): Now char[], not char*.
3022 (private_tempnam): Remove hardcoded limit on temporary file names.
3023 (exiterr, perror_fatal, main): When exiting because of a signal,
3024 exit with that signal's status.
3025 (lf_refill, main, skip_white, edit, interact): Check for signal.
3026 (ignore_SIGINT): Renamed from `ignore_signals'.
3027 (NUM_SIGS, initial_handler): New macros.
3028 (initial_action, signal_received, sigs_trapped): New vars.
3029 (catchsig, trapsigs): Use sigaction if possible, since this closes the
3030 windows of vulnerability that `signal' has. Use RETSIGTYPE not void.
3031 When a signal comes in, just set a global variable; this is safer.
3032 (checksigs, untrapsig): New functions.
3033 (edit): Pacify `gcc -Wall' with a useless assignment.
3034 Respond to each empty line with help, not to every other empty line.
3035 (private_tempnam): Remove hardcoded limit on temporary file name length.
3036 Don't assume sizeof (pid_t) <= sizeof (int).
3037
3038 * system.h: (S_IXOTH, S_IXGRP, S_IXUSR,
3039 SEEK_SET, SEEK_CUR,
3040 STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO):
3041 New macros, if system doesn't define them.
3042 (volatile): Don't define if already defined.
3043 (PARAMS): New macro.
3044 (VOID): Move here from diff.h.
3045
3046 * util.c (struct msg, msg_chain, msg_chain_end): Moved here from diff.h.
3047 (message5): New function.
3048 (pr_pid): New var.
3049 (begin_output): Allocate `name' more precisely.
3050 Put child pid into pr_pid, so that we can wait for it later.
3051 Don't check execl's return value, since any return must be an error.
3052 (finish_output): Detect and report output errors.
3053 Use waitpid if available. Check pr exit status.
3054 (line_cmp): Use locale's definition of white space
3055 instead of using one hardwired defn for -b and another for -w.
3056 (analyze_cmp): Avoid double negation with `! nontrivial'.
3057 Pacify `gcc -Wall' be rewriting for-loop into do-while-loop.
3058 (dir_file_pathname): New function.
3059
3060 * version.c (version_string): Now char[], not char*.
3061
3062Thu Jul 29 20:44:30 1993 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu)
3063
3064 * Makefile.in (config.status): Run config.status --recheck, not
3065 configure, to get the right args passed.
3066
3067Thu Jul 22 10:46:30 1993 Paul Eggert (eggert@twinsun.com)
3068
3069 * Makefile.in (dist): Replace `if [ ! TEST ]; then ACTION; fi'
3070 with `[ TEST ] || ACTION || exit' so that the containing for-loop exits
3071 with proper status for `make'.
3072
3073Thu Jul 8 19:47:22 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
3074
3075 * Makefile.in (installdirs): New target.
3076 (install): Use it.
3077 (Makefile, config.status, configure): New targets.
3078
3079Sat Jun 5 23:10:40 1993 Paul Eggert (eggert@twinsun.com)
3080
3081 * Makefile.in (dist): Switch from .z to .gz.
3082
3083Wed May 26 17:16:02 1993 Paul Eggert (eggert@twinsun.com)
3084
3085 * diff.c (main): Cast args to compare_files, for traditional C.
3086 * side.c (print_sdiff_common_lines, print_sdiff_hunk): Likewise.
3087 * analyze.c, diff3.c, sdiff.c, util.c: Don't assume NULL is defined
3088 properly.
3089
3090Tue May 25 14:54:05 1993 Paul Eggert (eggert@twinsun.com)
3091
3092 * analyze.c (diff_2_files): With -q, do not report that files differ
3093 if all their differences are ignored.
3094 (briefly_report): New function.
3095 * diff.h (ignore_some_changes): New variable.
3096 * diff.c (compare_files): Don't use the file size shortcut if
3097 ignore_some_changes is nonzero, since the file size may differ
3098 merely due to ignored changes.
3099 (main): Set ignore_some_changes if we might ignore some changes.
3100 Remove unsystematic assignment of 0 to static vars.
3101 * io.c (read_files): New argument PRETEND_BINARY says whether to
3102 pretend the files are binary.
3103
3104 * diff3.c (tab_align_flag): New variable, for new -T option.
3105 (main, usage, output_diff3): Add support for -T.
3106
3107Sun May 23 15:25:29 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu)
3108
3109 * dir.c (dir_sort): Always init `data' to avoid GCC warning.
3110
3111Sat May 22 15:35:02 1993 Paul Eggert (eggert@twinsun.com)
3112
3113 * Makefile.in (dist): Change name of package from diff to diffutils.
3114 Don't bother to build .Z dist; .z suffices.
3115
3116Fri May 21 16:35:22 1993 Paul Eggert (eggert@twinsun.com)
3117
3118 * diff.c: Include "system.h" to get memchr declaration.
3119 * system.h (memchr): Declare if !HAVE_MEMCHR, not if
3120 !HAVE_MEMCHR && !STDC_HEADERS.
3121
3122Wed May 19 17:43:55 1993 Paul Eggert (eggert@twinsun.com)
3123
3124 * Version 2.3 released.
3125
3126Fri Apr 23 17:18:44 1993 Paul Eggert (eggert@twinsun.com)
3127
3128 * io.c (find_identical_ends): Do not discard the last HORIZON_LINES
3129 lines of the prefix, or the first HORIZON_LINES lines of the suffix.
3130 * diff.c (main, longopts, usage): Add --horizon-lines option.
3131 * diff3.c (main, process_diff, read_diff): Invoke second diff
3132 with --horizon-lines determined by the first diff.
3133 * diff.h, diff3.c (horizon_lines): New variable.
3134
3135Mon Mar 22 16:16:00 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
3136
3137 * system.h [HAVE_STRING_H || STDC_HEADERS] (bcopy, bcmp, bzero):
3138 Don't define if already defined.
3139
3140Fri Mar 5 00:20:16 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu)
3141
3142 * diff.c (main): Use NULL in arg to compare_files.
3143
3144Thu Feb 25 15:26:01 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
3145
3146 * system.h: Declare memchr #if !HAVE_MEMCHR && !STDC_HEADERS,
3147 not #if !HAVE_MEMCHR || !STDC_HEADERS.
3148
3149Mon Feb 22 15:04:46 1993 Richard Stallman (rms@geech.gnu.ai.mit.edu)
3150
3151 * io.c (find_identical_ends): Move complicated arg outside GUESS_LINES.
3152
3153Mon Feb 22 12:56:12 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
3154
3155 * Makefile.in (.c.o): Add -I$(srcdir); put $(CFLAGS) last before $<.
3156
3157Sat Feb 20 19:18:56 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu)
3158
3159 * io.c (binary_file_p): Return zero if file size is zero.
3160
3161Fri Feb 19 17:31:32 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu)
3162
3163 * Version 2.2 released.
3164
3165 * system.h [HAVE_STRING_H || STDC_HEADERS] (index, rindex): Don't
3166 define if already defined.
3167
3168Wed Feb 17 17:08:00 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
3169
3170 * Makefile.in (srcs): Remove limits.h.
3171
3172Thu Feb 11 03:36:00 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu)
3173
3174 * diff3.c (xmalloc): No longer static.
3175
3176 * sdiff.c (edit): Allocate buf dynamically.
3177
3178 * dir.c (dir_sort): Handle VOID_CLOSEDIR.
3179
3180Wed Feb 10 00:15:54 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu)
3181
3182 * limits.h: File deleted (should never have been there).
3183
3184Tue Feb 9 03:53:22 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu)
3185
3186 * Makefile.in (.c.o, diff3.o, sdiff.o): Put $(CFLAGS) last.
3187
3188Wed Feb 3 15:42:10 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
3189
3190 * system.h: Don't #define const; let configure do it.
3191
3192Mon Feb 1 02:13:23 1993 Paul Eggert (eggert@hal.gnu.ai.mit.edu)
3193
3194 * Version 2.1 released.
3195
3196 * Makefile.in (dist): Survive ln failures. Create .tar.z
3197 (gzipped tar) file as well as .tar.Z (compressed tar) file.
3198
3199Fri Jan 8 22:31:41 1993 Paul Eggert (eggert@twinsun.com)
3200
3201 * side.c (print_half_line): When the input position falls
3202 outside the column, do not output a tab even if the output
3203 position still falls within the column.
3204
3205Mon Dec 21 13:54:36 1992 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu)
3206
3207 * Makefile.in (.c.o): Add -I.
3208
3209Fri Dec 18 14:08:20 1992 Paul Eggert (eggert@twinsun.com)
3210
3211 * configure.in: Add HAVE_FCNTL_H, since system.h uses it.
3212
3213Tue Nov 24 10:06:48 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
3214
3215 * Makefile.in: Note change from USG to HAVE_STRING_H.
3216
3217Mon Nov 23 18:44:00 1992 Paul Eggert (eggert@twinsun.com)
3218
3219 * io.c (find_and_hash_each_line): When running out of lines,
3220 double the number of allocated lines, instead of just doubling
3221 that number minus the prefix lines. This is more likely to
3222 avoid the need for further memory allocation.
3223
3224Wed Nov 18 20:40:28 1992 Paul Eggert (eggert@twinsun.com)
3225
3226 * dir.c (dir_sort): Plug memory leak: space holding directory
3227 contents was not being reclaimed. Get directory size from
3228 struct file_data for initial guess at memory needed.
3229 Detect errors when reading and closing directory.
3230 (diff_dirs): Pass struct file_data to dir_sort. Finish plugging leak.
3231 * diff.c (compare_files): Pass struct file_data to diff_dirs.
3232
3233 * io.c (find_and_hash_each_line): Don't assume alloc_lines is
3234 nonzero when allocating more lines.
3235
3236Thu Nov 12 16:02:18 1992 Paul Eggert (eggert@twinsun.com)
3237
3238 * diff.c (main): Add `-U lines' as an alias for `--unified=lines'.
3239
3240 * diff3.c (usage): Add third --label option in example.
3241
3242 * util.c (analyze_hunk): Fix test for ignoring blank lines.
3243
3244 * configure.in, system.h: Avoid USG; use HAVE_TIME_H etc. instead.
3245
3246Mon Nov 9 05:13:25 1992 Paul Eggert (eggert@twinsun.com)
3247
3248 * diff3.c (main, usage): Add -A or --show-all.
3249 -m now defaults to -A, not -E. Allow up to three -L options.
3250 (output_diff3_edscript, output_diff3_merge):
3251 Remove spurious differences between these two functions.
3252 Output ||||||| for -A. Distinguish between conflicts and overlaps.
3253 (dotlines, undotlines): New functions that output `Ns', not `N,Ns'.
3254 (output_diff3_edscript, output_diff3_merge): Use them.
3255
3256 * io.c (find_identical_ends): shift_boundaries needs an extra
3257 identical line at the end, not at the beginning.
3258
3259 * sdiff.c (edit): execvp wants char **, not const char **.
3260
3261Mon Oct 19 04:39:32 1992 Paul Eggert (eggert@twinsun.com)
3262
3263 * context.c (print_context_script, find_function): Context
3264 line numbers start with - file->prefix_lines, not 0.
3265
3266 * io.c (binary_file_p): Undo last change; it was a library bug.
3267
3268Sun Oct 18 00:17:29 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu)
3269
3270 * io.c (binary_file_p): Consider empty file as non-binary.
3271
3272Mon Oct 5 05:18:46 1992 Paul Eggert (eggert@twinsun.com)
3273
3274 * diff3.c (main, make_3way_diff, using_to_diff3_block): Don't
3275 report bogus differences (for one of -mexEX3) just because the
3276 file0-file1 diffs don't line up with the file0-file2 diffs.
3277 (This is entirely possible since we don't use diff's -n
3278 option.) Always compare file1 to file2, so that diff3 sees
3279 those changes directly. Typically, file2 is now the common
3280 file, not file0.
3281 (output_diff3_merge): The input file is file 0, not the common file.
3282
3283 (FC, FO): New macros; they replace FILE1, FILE0 for two-way diffs,
3284 to distinguish them from three-way diffs.
3285
3286 * diff3.c (using_to_diff3_block): Fold repeated code into loops.
3287
3288 * diff3.c (make_3way_diff, process_diff): Have the *_end
3289 variable point to the next field to be changed, not to the last
3290 object allocated; this saves an if-then-else.
3291
3292 * diff3.c (process_diff): Use D_NUMLINES instead of its definiens.
3293
3294 * diff3.c: Make fns and vars static unless they must be external.
3295
3296Wed Sep 30 09:21:59 1992 Paul Eggert (eggert@twinsun.com)
3297
3298 * analyze.c (diff_2_files): OUTPUT_IFDEF is now robust.
3299 * diff.h (ROBUST_OUTPUT_STYLE): Likewise.
3300 (default_line_format): Remove. All refs removed.
3301
3302 * ifdef.c (print_ifdef_lines): Add %L. Optimize %l\n even if user
3303 specified it, as opposed to its being the default.
3304
3305Tue Sep 29 19:01:28 1992 Paul Eggert (eggert@twinsun.com)
3306
3307 * diff.c (longopts, main): --{old,new,unchanged,changed}--group-format
3308 are new options, so that -D is no longer overloaded. Set
3309 no_diff_means_no_output if --unchanged-{line,group}-format allows it.
3310 * diff.h (enum line_class): New type.
3311 (group_format, line_format): Use it to regularize option flags.
3312 All refs changed.
3313
3314 * ifdef.c (format_ifdef, print_ifdef_lines): %n is no longer a format.
3315
3316Mon Sep 28 04:51:42 1992 Paul Eggert (eggert@twinsun.com)
3317
3318 * diff.c (main, usage): Replace --line-prefix with the more general
3319 --{old,new,unchanged}-line-format options.
3320 * ifdef.c (format_ifdef, print_ifdef_lines): Likewise.
3321 * diff.h (line_format): Renamed from line_prefix. All refs changed.
3322 * diff.h, ifdef.c (default_line_format): New variable.
3323 * util.c (output_1_line): New function.
3324 (print_1_line): Use it.
3325
3326 * ifdef.c: (format_ifdef, print_ifdef_lines): Add %0 format.
3327
3328Sun Sep 27 05:38:13 1992 Paul Eggert (eggert@twinsun.com)
3329
3330 * diff.c (main): Add -E or --line-prefix option. Add -D'=xxx'
3331 for common lines. Change default -D< format from copy of -D>
3332 format to to -D<%<; similarly for default -D> format.
3333 * diff.h (common_format, line_prefix): New variables.
3334 * ifdef.c (format_ifdef): New function.
3335 (print_ifdef_script, print_ifdef_hunk, print_ifdef_lines):
3336 Use it for -D'=xxx', -E.
3337
3338 * context.c (find_hunk): Glue together two non-ignorable changes that
3339 are exactly CONTEXT * 2 lines apart. This shortens output, removes
3340 a behavioral discontinuity at CONTEXT = 0, and is more compatible
3341 with traditional diff.
3342
3343 * io.c (find_identical_ends): Slurp stdin at most once.
3344
3345 * util.c (print_line_line): line_flag is const char *.
3346
3347Thu Sep 24 15:18:07 1992 Paul Eggert (eggert@twinsun.com)
3348
3349 * ifdef.c (print_ifdef_lines): New function, which fwrites a sequence
3350 of lines all at once for speed.
3351 (print_ifdef_script, print_ifdef_hunk): Use it.
3352
3353Thu Sep 24 05:54:14 1992 Paul Eggert (eggert@twinsun.com)
3354
3355 * diff.c (main): Support new -D options for if-then-else formats.
3356 (specify_format): New function.
3357 * diff.h (ifndef_format, ifdef_format, ifnelse_format): New variables.
3358 * ifdef.c (print_ifdef_hunk): Use the new variables instead of
3359 a hardwired format.
3360
3361 * side.c (print_1sdiff_line): Represent incomplete lines on output.
3362 (print_sdiff_script): Likewise. Don't print 'q' at end,
3363 since that doesn't work with incomplete lines.
3364 * sdiff.c (interact): Don't assume diff output ends with 'q' line.
3365 * diff.h (ROBUST_OUTPUT_STYLE): OUTPUT_SDIFF is now robust.
3366
3367 * sdiff.c (lf_copy, lf_snarf): Use memchr instead of index,
3368 to avoid dumping core when files contain null characters.
3369 (memchr): New function (if memchr is missing).
3370
3371 * io.c (sip): New arg SKIP_TEST to skip test for binary file.
3372 (read_files): Don't bother testing second file if first is binary.
3373
3374Thu Sep 17 21:17:49 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
3375
3376 * system.h [!USG && !_POSIX_VERSION]: Protect from conflicting
3377 prototype for wait in sys/wait.h.
3378
3379Wed Sep 16 12:32:18 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
3380
3381 * Makefile.in: Include binprefix in -DDIFF_PROGRAM.
3382
3383Tue Sep 15 14:27:25 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
3384
3385 * Version 2.0.
3386
3387Sat Sep 12 01:31:19 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
3388
3389 * util.c, diff.h, system.h [!HAVE_MEMCHR]: Don't use void *
3390 and const when declaring memchr replacement. Declare memchr
3391 if !STDC_HEADERS && !USG.
3392
3393Thu Sep 10 15:17:32 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
3394
3395 * Makefile.in (uninstall): New target.
3396
3397 * diff.c (excluded_filename): Use fnmatch, not wildmat.
3398 (usage): Document -x, -X, --exclude, --exclude-from.
3399 Makefile.in: Use fnmatch.c, not wildmat.c.
3400
3401Sun Sep 6 23:46:25 1992 Paul Eggert (eggert@twinsun.com)
3402
3403 * configure.in: Add HAVE_MEMCHR.
3404 * diff.h, util.c: Use it instead of MEMCHR_MISSING.
3405
3406Sun Sep 6 07:25:49 1992 Paul Eggert (eggert@twinsun.com)
3407
3408 * diff.h: (struct line_def): Replace this 3-word struct with char *.
3409 This uses less memory, particularly for large files with short lines.
3410 (struct file_data): New member linbuf_base counts number of lines
3411 in common prefix that are not recorded in linbuf;
3412 this uses less memory if files are identical or differ only at end.
3413 New member buffered_lines counts possibly differing lines.
3414 New member valid_lines counts valid data.
3415 New member alloc_lines - linbuf_base replaces old linbufsize.
3416 linbuf[0] now always points at first differing line.
3417 Remove unused members ltran, suffix_lines.
3418 Add const where appropriate.
3419 (Is_space): New macro, for consistent definition of `white space'.
3420 (excluded_filename, memchr, sip, slurp): New declarations.
3421 * ed.c (print_ed_hunk): Adjust to diff.h's struct changes.
3422 * context.c (pr_context_hunk): Likewise.
3423 * ifdef.c (print_ifdef_script): Likewise.
3424 * side.c (print_sdiff_script, print_half_line): Likewise.
3425 * util.c (analyze_hunk, line_cmp, print_1_line): Likewise.
3426
3427 * analyze.c (shift_boundaries): Remove unneeded variable `end' and
3428 unnecessary comparisons of `preceding' and `other_preceding' against 0.
3429 (diff_2_files): When comparing files byte-by-byte for equality,
3430 don't slurp them all in at once; just compare them a buffer at a time.
3431 This can win big if they differ early on.
3432 Move some code to compare_files to enable this change.
3433 Use only one buffer for stdin with `diff - -'.
3434 (discard_confusing_lines, diff_2_files): Coalesce malloc/free calls.
3435 (build_script): Remove obsolete OUTPUT_RCS code.
3436
3437 * diff.c (add_exclude, add_exclude_file, excluded_filename): New fns.
3438 (main): Use them for the new --exclude and --exclude-from options.
3439 (compare_files): Don't open a file unless it must be read.
3440 Treat `diff file file' and `diff file dir' similarly.
3441 Move some code here from diff_2_files to enable this.
3442 Simplify file vs dir warning.
3443
3444 * dir.c (dir_sort): Support new --exclude* options.
3445
3446 * io.c (struct equivclass): Put hash code and line length here instead
3447 of struct line_def, so that they can be shared.
3448 (find_and_hash_each_line): Compute equivalence class as we go,
3449 instead of doing it in a separate pass; this thrashes memory less.
3450 Make buckets realloc-able, since we can't preallocate them.
3451 Record one more line start than there are lines, so that we can compute
3452 any line's length by subtracting its start from the next line's,
3453 instead of storing the length explicitly. This saves memory.
3454 Move prefix-handling code to find_identical_ends;
3455 this wins with large prefixes.
3456 Use Is_space, not is_space, for consistent treatment of white space.
3457 (prepare_text_end): New function.
3458 (find_identical_ends): Move slurping here, so it's only done when
3459 needed. Work even if the buffers are the same (because of `diff - -').
3460 Compare prefixes a word at a time for speed.
3461 (find_equiv_class): Delete; now done by find_and_hash_each_line.
3462 (read_files): Don't slurp unless needed.
3463 find_equiv_class's work is now folded into find_and_hash_each_line.
3464 Don't copy stdin buffer if `diff - -'.
3465 Check for running out of primes.
3466 (sip, slurp): Split first part of `slurp' into another function `sip'.
3467 `sip' sets things up and perhaps reads the first ST_BLKSIZE buffer to
3468 see whether the file is binary; `slurp' now just finishes the job.
3469 This lets diff_2_files compare binary files lazily.
3470 Allocate a one-word sentinel to allow word-at-a-time prefix comparison.
3471 Count prefix lines only if needed, only count the first file's prefix.
3472 Don't bother to count suffix lines; it's never needed.
3473 Set up linbuf[0] to point at first differing line.
3474 (binary_file_p): Change test for binary files:
3475 if it has a null byte in its first buffer, it's binary.
3476 (primes): Add more primes.
3477
3478 * util.c (line_cmp): Use bcmp for speed.
3479 Use Is_space, not is_space, for consistent treatment of white space.
3480 (translate_line_number): Internal line numbers now count from 0
3481 starting after the prefix.
3482 (memchr): New function (if memchr is missing).
3483
3484 * Makefile.in: Document HAVE_ST_BLKSIZE. Link with wildmat.o.
3485 * system.h (STAT_BLOCKSIZE): New macro based on HAVE_ST_BLKSIZE.
3486 * configure.in: Add AC_ST_BLKSIZE.
3487 * wildmat.c: New file.
3488
3489Fri Sep 4 01:28:51 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu)
3490
3491 * sdiff.c (xmalloc): Renamed from ck_malloc. Callers changed.
3492
3493Thu Sep 3 15:28:59 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
3494
3495 * diff.h: Don't declare free, index, rindex.
3496
3497Tue Aug 11 22:18:06 1992 John Gilmore (gnu at cygnus.com)
3498
3499 * io.c (binary_file_p): Use heuristic to avoid declaring info
3500 files as binary files. Allow about 1.5% non-printing
3501 characters (in info's case, ^_).
3502
3503Tue Jul 7 01:09:26 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
3504
3505 * diff.h: Replace function_regexp and ignore_regexp with lists
3506 of compiled regexps.
3507 * analyze.c, context.c, util.c: Test whether the lists, not
3508 the old variables, are empty.
3509 * util.c (analyze_hunk), context.c (find_function): Compare
3510 lines with the lists of regexps.
3511 * diff.c (add_regexp): New function.
3512 (main): Use it.
3513
3514 * diff3: Add -v --version option.
3515 * Makefile.in: Link with version.o.
3516
3517 * system.h: New file.
3518 * diff.h, cmp.c, diff3.c, sdiff.c: Use it.
3519
3520 * diff.h, diff3.c: Include string.h or strings.h, as appropriate.
3521 Declare malloc and realloc.
3522
3523 * diff3.c (perror_with_exit): Include program name in message.
3524
3525 * diff3.c: Lowercase error messages for GNU standards.
3526
3527 * sdiff.c [USG || STDC_HEADERS]: Define bcopy in terms of memcpy.
3528
3529 * sdiff.c: Use the version number from version.c.
3530 * Makefile.in: Link with version.o.
3531
3532 * cmp.c error.c xmalloc.c: New files from textutils.
3533 * Makefile.in: Add rules for them.
3534
3535 * diff.c (longopts): --unidirectional-new-file is like -P, not -N.
3536 Rename --file-label to --label (leave old name, but undocumented).
3537
3538 * sdiff.c, diff.c (usage): Condense messages and fix some errors.
3539
3540 * diff3.c (main, usage): Add long-named options.
3541
3542Fri Jul 3 14:31:18 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
3543
3544 * diff.h, diff3.c, sdiff.c: Change FOO_MISSING macros to HAVE_FOO.
3545
3546Thu Jun 25 16:59:47 1992 David J. MacKenzie (djm@apple-gunkies.gnu.ai.mit.edu)
3547
3548 * diff.c: --reversed-ed -> --forward-ed.
3549
3550Wed Feb 26 12:17:32 1992 Paul Eggert (eggert@yata.uucp)
3551
3552 * analyze.c, diff.c, diff.h, io.c: For -y, compare even if same file.
3553
3554Fri Feb 14 22:46:38 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu)
3555
3556 * io.c, diff3.c, analyze.c: Add extra parentheses.
3557
3558Sun Feb 9 00:22:42 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu)
3559
3560 * diff.h (unidirectional_new_file_flag): New variable.
3561 * diff.c (main): Set that for -P.
3562 (compare_files): Support -P, somewhat like -N.
3563 (longopts): Support long name for -P.
3564
3565Sat Jan 4 20:10:34 1992 Paul Eggert (eggert at yata.uucp)
3566
3567 * Makefile.in: Distribute diff.info-* too.
3568
3569 * README, sdiff.c: version number now matches version.c.
3570
3571 * configure: Fix and document vfork test.
3572
3573 * ifdef.c: Don't dump core if `diff -Dx f f'.
3574
3575Mon Dec 23 23:36:08 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)
3576
3577 * diff.h, diff3.c, sdiff.c: Change POSIX ifdefs to
3578 HAVE_UNISTD_H and _POSIX_VERSION.
3579
3580Wed Dec 18 17:00:31 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)
3581
3582 * Makefile.in (srcs): Add sdiff.c.
3583 (tapefiles): Add diff.texi and diff.info.
3584
3585 * diff.h, diff3.c, sdiff.c: Use HAVE_VFORK_H instead of
3586 VFORK_HEADER and VFORK_WORKS.
3587
3588Tue Dec 17 00:02:59 1991 Paul Eggert (eggert at yata.uucp)
3589
3590 * Makefile.in (all): Add diff.info, sdiff.
3591
3592 * configure, diff.c, sdiff.c:
3593 Prefix long options with `--', not `+'.
3594 * diff.c: Regularize option names.
3595
3596 * configure: Fix check for vfork.
3597 * configure, diff.c, diff.h, diff3.c, sdiff.c:
3598 Use Posix definitions when possible.
3599
3600 * context.c: Align context with tab if -T is given. Tune.
3601 * diff.c, diff.h, side.c: Calculate column widths so that tabs line up.
3602 * io.c: Add distinction between white space and printing chars.
3603 * side.c: Don't expand tabs unless -t is given.
3604 * side.c, util.c: Tab expansion now knows about '\b', '\f', '\r', '\v'.
3605 * util.c: -w skips all white space. Remove lint. Tune.
3606
3607 * sdiff.c: Support many more diff options, e.g. `-', `sdiff file dir'.
3608 Ignore interrupts while the subsidiary editor is in control.
3609 Clean up temporary file and kill subsidiary diff if interrupted.
3610 Ensure subsidiary diff doesn't ignore SIGPIPE.
3611 Don't get confused while waiting for two subprocesses.
3612 Don't let buffers overflow. Check for I/O errors.
3613 Convert to GNU style. Tune.
3614
3615 * sdiff.c, util.c: Don't lose errno.
3616 Don't confuse sdiff with messages like `Binary files differ'.
3617 * sdiff.c, side.c: Don't assume that common lines are identical.
3618 Simplify --sdiff-merge-assist format.
3619
3620Mon Sep 16 16:42:01 1991 Tom Lord (lord at churchy.gnu.ai.mit.edu)
3621
3622 * Makefile.in, sdiff.c: introduced sdiff front end to diff.
3623
3624 * Makefile.in, analyze.c, diff.c, diff.h, io.c, side.c: Added
3625 sdiff-style output format to diff.
3626
3627Mon Aug 26 16:44:55 1991 David J. MacKenzie (djm at pogo.gnu.ai.mit.edu)
3628
3629 * Makefile.in, configure: Only put $< in Makefile if using VPATH,
3630 because older makes don't understand it.
3631
3632Fri Aug 2 12:22:30 1991 David J. MacKenzie (djm at apple-gunkies)
3633
3634 * configure: Create config.status. Remove it and Makefile if
3635 interrupted while creating them.
3636
3637Thu Aug 1 22:24:31 1991 David J. MacKenzie (djm at apple-gunkies)
3638
3639 * configure: Check for +srcdir etc. arg and look for
3640 Makefile.in in that directory. Set VPATH if srcdir is not `.'.
3641 * Makefile.in: Get rid of $(archpfx).
3642
3643Tue Jul 30 21:28:44 1991 Richard Stallman (rms at mole.gnu.ai.mit.edu)
3644
3645 * Makefile.in (prefix): Renamed from DESTDIR.
3646
3647Wed Jul 24 23:08:56 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)
3648
3649 * diff.h, diff3.c: Rearrange ifdefs to use POSIX,
3650 STDC_HEADERS, VFORK_MISSING, DIRENT. This way it works on
3651 more systems that aren't pure USG or BSD.
3652 Don't not define const if __GNUC__ is defined -- that would
3653 break with -traditional.
3654 * configure: Check for those features.
3655
3656Wed Jul 10 01:39:23 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)
3657
3658 * configure, Makefile.in: $(INSTALLPROG) -> $(INSTALL).
3659
3660Sat Jul 6 16:39:04 1991 David J. MacKenzie (djm at geech.gnu.ai.mit.edu)
3661
3662 * Replace Makefile with configure and Makefile.in.
3663 Update README with current compilation instructions.
3664
3665Sat Jul 6 14:03:29 1991 Richard Stallman (rms at mole.gnu.ai.mit.edu)
3666
3667 * util.c (setup_output): Just save the args for later use.
3668 (begin_output): Do the real work, with the values that were saved.
3669 It's safe to call begin_output more than once.
3670 Print the special headers for context format here.
3671 * analyze.c (diff_2_files): Don't print special headers here.
3672 * context.c (pr_context_hunk, pr_unidiff_hunk): Call begin_output.
3673 * ed.c (print_ed_hunk, print_forward_ed_hunk, print_rcs_hunk):
3674 * normal.c (print_normal_hunk): Likewise.
3675 * ifdef.c (print_ifdef_hunk): Likewise.
3676 * util.c (finish_output): Don't die if begin_output was not called.
3677
3678Thu Jun 20 23:10:01 1991 David J. MacKenzie (djm at geech.gnu.ai.mit.edu)
3679
3680 * Makefile: Add TAGS, distclean, and realclean targets.
3681 Set SHELL.
3682
3683Tue Apr 30 13:54:36 1991 Richard Stallman (rms at mole.gnu.ai.mit.edu)
3684
3685 * diff.h (TRUE, FALSE): Undefine these before defining.
3686
3687Thu Mar 14 18:27:27 1991 Richard Stallman (rms@mole.ai.mit.edu)
3688
3689 * Makefile (objs): Include $(ALLOCA).
3690
3691Sat Mar 9 22:34:03 1991 Richard Stallman (rms at mole.ai.mit.edu)
3692
3693 * diff.h: Include regex.h.
3694
3695Thu Feb 28 18:59:53 1991 Richard Stallman (rms at mole.ai.mit.edu)
3696
3697 * Makefile (diff3): Link with GNU getopt.
3698
3699Sat Feb 23 12:49:43 1991 Richard Stallman (rms at mole.ai.mit.edu)
3700
3701 * io.c (find_equiv_class): Make hash code unsigned before mod.
3702
3703 * diff.h (files): Add EXTERN.
3704
3705Sun Jan 13 21:33:01 1991 Richard Stallman (rms at mole.ai.mit.edu)
3706
3707 * diff.c: +print option renamed +paginate. Remove +all-text.
3708
3709Mon Jan 7 06:18:01 1991 David J. MacKenzie (djm at geech.ai.mit.edu)
3710
3711 * Makefile (dist): New target, replacing diff.tar and
3712 diff.tar.Z, to encode version number in distribution directory
3713 and tar file names.
3714
3715Sun Jan 6 18:42:23 1991 Michael I Bushnell (mib at geech.ai.mit.edu)
3716
3717 * Version 1.15 released.
3718
3719 * version.c: Updated from 1.15 alpha to 1.15
3720
3721 * context.c (print_context_number_range,
3722 print_unidiff_number_range): Don't print N,M when N=M, print
3723 just N instead.
3724
3725 * README: Updated for version 1.15.
3726 Makefile: Updated for version 1.15.
3727
3728 * diff3.c (main): Don't get confused if one of the arguments
3729 is a directory.
3730
3731 * diff.c (compare_files): Don't get confused if comparing
3732 standard input to a directory; print error instead.
3733
3734 * analyze.c (diff_2_files), context.c (print_context_header,
3735 print_context_script), diff.c (main), diff.h (enum
3736 output_style): Tread unidiff as an output style in its own
3737 right. This also generates an error when both -u and -c are
3738 given.
3739
3740 * diff.c (main): Better error messages when regexps are bad.
3741
3742 * diff.c (compare_files): Don't assume stdin is opened.
3743
3744 * diff3.c (read_diff): Don't assume things about the order of
3745 descriptor assignment and closes.
3746
3747 * util.c (setup_output): Don't assume things about the order
3748 of descriptor assignment and closes.
3749
3750 * diff.c (compare_files): Set a flag so that closes don't
3751 happen more than once.
3752
3753 * diff.c (main): Don't just flush stdout, do a close. That
3754 way on broken systems we can still get errors.
3755
3756Mon Dec 24 16:24:17 1990 Richard Stallman (rms at mole.ai.mit.edu)
3757
3758 * diff.c (usage): Use = for args of long options.
3759
3760Mon Dec 17 18:19:20 1990 Michael I Bushnell (mib at geech.ai.mit.edu)
3761
3762 * context.c (print_context_label): Labels were interchanged badly.
3763
3764 * context.c (pr_unidiff_hunk): Changes to deal with files
3765 ending in incomplete lines.
3766 * util.c (print_1_line): Other half of the changes.
3767
3768Mon Dec 3 14:23:55 1990 Richard Stallman (rms at mole.ai.mit.edu)
3769
3770 * diff.c (longopts, usage): unidiff => unified.
3771
3772Wed Nov 7 17:13:08 1990 Richard Stallman (rms at mole.ai.mit.edu)
3773
3774 * analyze.c (diff_2_files): No warnings about newlines for -D.
3775
3776 * diff.c (pr_unidiff_hunk): Remove ref to output_patch_flag.
3777
3778Tue Oct 23 23:19:18 1990 Richard Stallman (rms at mole.ai.mit.edu)
3779
3780 * diff.c (compare_files): For -D, compare even args are same file.
3781 * analyze.c (diff_2_files): Likewise.
3782 Also, output even if files have no differences.
3783
3784 * analyze.c (diff_2_files): Print missing newline messages last.
3785 Return 2 if a newline is missing.
3786 Print them even if files end with identical text.
3787
3788Mon Oct 22 19:40:09 1990 Richard Stallman (rms at mole.ai.mit.edu)
3789
3790 * diff.c (usage): Return 2.
3791
3792Wed Oct 10 20:54:04 1990 Richard Stallman (rms at mole.ai.mit.edu)
3793
3794 * diff.c (longopts): Add +new-files.
3795
3796Sun Sep 23 22:49:29 1990 Richard Stallman (rms at mole.ai.mit.edu)
3797
3798 * context.c (print_context_script): Handle unidiff_flag.
3799 (print_context_header): Likewise.
3800 (print_unidiff_number_range, pr_unidiff_hunk): New functions.
3801 * diff.c (longopts): Add element for +unidiff.
3802 (main): Handle +unidiff and -u.
3803 (usage): Mention them.
3804
3805Wed Sep 5 16:33:22 1990 Richard Stallman (rms at mole.ai.mit.edu)
3806
3807 * io.c (find_and_hash_each_line): Deal with missing final newline
3808 after buffering necessary context lines.
3809
3810Sat Sep 1 16:32:32 1990 Richard Stallman (rms at mole.ai.mit.edu)
3811
3812 * io.c (find_identical_ends): ROBUST_OUTPUT_FORMAT test was backward.
3813
3814Thu Aug 23 17:17:20 1990 Richard Stallman (rms at mole.ai.mit.edu)
3815
3816 * diff3.c (WIFEXITED): Undef it if WEXITSTATUS is not defined.
3817 * context.c (find_function): Don't try to return values.
3818
3819Wed Aug 22 11:54:39 1990 Richard Stallman (rms at mole.ai.mit.edu)
3820
3821 * diff.h (O_RDONLY): Define if not defined.
3822
3823Tue Aug 21 13:49:26 1990 Richard Stallman (rms at mole.ai.mit.edu)
3824
3825 * Handle -L option.
3826 * context.c (print_context_label): New function.
3827 (print_context_header): Use that.
3828 * diff.c (main): Recognize the option.
3829 (usage): Updated.
3830 * diff.h (file_label): New variable.
3831 * diff3.c (main): Recognize -L instead of -t.
3832
3833 * diff3.c (main): Support -m without other option.
3834
3835 * diff3.c (WEXITSTATUS, WIFEXITED): Define whenever not defined.
3836
3837 * diff3.c (bcopy, index, rindex): Delete definitions; not used.
3838 (D_LINENUM, D_LINELEN): Likewise.
3839 (struct diff_block): lengths includes newlines.
3840 (struct diff3_block): Likewise.
3841 (always_text, merge): New variables.
3842 (read_diff): Return address of end, not size read. Calls changed.
3843 Pass -a to diff if given to diff3.
3844 current_chunk_size now an int. Detect error in `pipe'.
3845 Check for incomplete line of output here.
3846 (scan_diff_line): Don't make scan_ptr + 2 before knowing it is valid.
3847 No need to check validity of diff output here.
3848 Include newline in length of line.
3849 (main): Compute rev_mapping here. Handle -a and -m.
3850 Error message if excess -t operands. Error for incompatible options.
3851 Error if `-' given more than once.
3852 Fix error storing in tag_strings.
3853 (output_diff3): REV_MAPPING is now an arg. Call changed.
3854 Change syntax of "missing newline" message.
3855 Expect length of line to include newline.
3856 (output_diff3_edscript): Return just 0 or 1.
3857 REV_MAPPING is now an arg. Call changed.
3858 (output_diff3_merge): New function.
3859 (process_diff): Better error message for bad diff format.
3860 (fatal, perror_with_exit): Return status 2.
3861
3862 * analyze.c (diff_2_files): Report missing newline in either
3863 or both files, if not robust output style.
3864
3865 * util.c (setup_output): Detect error from pipe.
3866 No need to close stdin.
3867
3868 * util.c (print_1_line): Change format of missing-newline msg.
3869 Change if statements to switch.
3870
3871 * io.c (slurp): Don't mention differences in final newline if -B.
3872
3873 * io.c (binary_file_p): Use ISO char set as criterion, not ASCII.
3874
3875 * io.c (find_identical_ends): Increase value of BEG0 by 1.
3876 Other changes in backwards scan to avoid decrementing pointers
3877 before start of array, and set LINES properly.
3878
3879 * diff.h (ROBUST_OUTPUT_STYLE): New macro.
3880 * io.c (find_identical_ends, find_and_hash_each_line): Use that macro.
3881
3882 * diff.h (dup2): Don't define if XENIX.
3883
3884 * diff.c (main): Check for write error at end.
3885
3886 * context.c (find_function): Don't return a value.
3887 Use argument FILE rather than global files.
3888
3889 * analyze.c: Add external function declarations.
3890 * analyze.c (build_script): Turn off explicit check for final newline.
3891
3892 * analyze.c (discard_confusing_lines): Make integers unsigned.
3893
3894Tue Jul 31 21:37:16 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
3895
3896 * io.c (find_and_hash_each_line): Correct the criterion
3897 for leaving out the newline from the end of the line.
3898
3899Tue May 29 21:28:16 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
3900
3901 * dir.c (diff_dirs): Free things only if nonzero.
3902
3903Mon Apr 16 18:31:05 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
3904
3905 * diff.h (NDIR_IN_SYS): New macro controls location of ndir.h.
3906
3907 * diff3.c (xmalloc, xrealloc): Don't die if size == 0 returns 0.
3908
3909Sun Mar 25 15:58:42 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
3910
3911 * analyze.c (discard_confusing_lines):
3912 `many' wasn't being used; use it.
3913 Canceling provisionals near start of run must handle already
3914 canceled provisionals.
3915 Canceling subruns of provisionals was canceling last nonprovisional.
3916
3917Sat Mar 24 14:02:51 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
3918
3919 * analyze.c (discard_confusing_lines):
3920 Threshold for line occurring many times scales by square root
3921 of total lines.
3922 Within each run, cancel any long subrun of provisionals.
3923 Don't update `provisional' while canceling provisionals.
3924 In big outer loop, handle provisional and nonprovisional separately.
3925
3926Thu Mar 22 16:35:33 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
3927
3928 * analyze.c (discard_confusing_lines):
3929 The first loops to discard provisionals from ends failed to step.
3930 In second such loops, keep discarding all consecutive provisionals.
3931 Increase threshold for stopping discarding, and also check for
3932 consecutive nondiscardables as separate threshold.
3933
3934Fri Mar 16 00:33:08 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
3935
3936 * diff3.c (read_diff): Pass -- as first arg to diff.
3937
3938 * diff3.c: Include wait.h or define equivalent macros.
3939 (read_diff): Don't use stdio printing error in the inferior.
3940 Remember the pid and wait for it. Report failing status.
3941 Report failure of vfork.
3942
3943Sun Mar 11 17:10:32 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
3944
3945 * diff3.c (main): Accept -t options and pass to output_diff3_edscript.
3946 (usage): Mention -t.
3947 (read_diff): Use vfork.
3948 (vfork): Don't use it on Sparc.
3949
3950 * diff.h (vfork): Don't use it on Sparc.
3951
3952Tue Mar 6 22:37:20 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
3953
3954 * diff3.c (dup2): Don't define on Xenix.
3955
3956 * Makefile: Comments for Xenix.
3957
3958Thu Mar 1 17:19:23 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
3959
3960 * analyze.c (diff_2_files): `message' requires three args.
3961
3962Fri Feb 23 10:56:50 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
3963
3964 * diff.h, util.c, diff3.c: Change 'void *' to 'VOID *', with
3965 VOID defined as void if __STDC__, char if not.
3966
3967Sun Feb 18 20:31:58 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
3968
3969 * Makefile: Add rules for getopt.c, getopt1.c, getopt.h.
3970
3971 * getopt.c, getopt.h, getopt1.c: New files.
3972
3973 * main.c (main, usage): Add long options.
3974
3975 * analyze.c (shift_boundaries): Remove unused var 'j_end'.
3976
3977Thu Feb 8 02:43:16 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
3978
3979 * GNUmakefile: include ../Makerules before Makefile.
3980
3981Fri Feb 2 23:21:38 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
3982
3983 * analyze.c (diff_2_files): If -B or -I, don't return 1
3984 if all changes were ignored.
3985
3986Wed Jan 24 20:43:57 1990 Richard Stallman (rms at albert.ai.mit.edu)
3987
3988 * diff3.c (fatal): Output to stderr.
3989
3990Thu Jan 11 00:25:56 1990 David J. MacKenzie (djm at hobbes.ai.mit.edu)
3991
3992 * diff.c (usage): Mention -v.
3993
3994Wed Jan 10 16:06:38 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
3995
3996 * diff3.c (output_diff3_edscript): Return number of overlaps.
3997 (main): If have overlaps, exit with status 1.
3998
3999Sun Dec 24 10:29:20 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
4000
4001 * io.c (find_equiv_class): Fix typo that came from changing init of B
4002 to an assignment.
4003
4004 * version.c: New file.
4005 * diff.c (main): -v prints version number.
4006
4007 * io.c (binary_file_p): Null char implies binary file.
4008
4009Fri Nov 17 23:44:55 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
4010
4011 * util.c (print_1_line): Fix off by 1 error.
4012
4013Thu Nov 16 13:51:10 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
4014
4015 * util.c (xcalloc): Function deleted.
4016
4017 * io.c (slurp): Null-terminate the buffer.
4018
4019 * io.c (read_files): Delete unused vars.
4020
4021 * io.c (find_equiv_class): Don't index by N if too low.
4022
4023 * dir.c (dir_sort): Delete the extra declaration of compare_names.
4024
4025 * diff.h: Don't declare xcalloc. Declare some other functions.
4026
4027 * analyze.c (shift_boundaries):
4028 Test for END at end of range before indexing by it.
4029 Fix misspelling of `preceding' in var names.
4030
4031Sat Nov 11 14:04:16 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
4032
4033 * diff3.c (using_to_diff3_block): Delete unused vars.
4034 (make_3way_diff, process_diff_control, read_diff, output_diff3): Likewise.
4035
4036Mon Nov 6 18:15:50 EST 1989 Jay Fenlason (hack@ai.mit.edu)
4037
4038 * README Fix typo.
4039
4040Fri Nov 3 15:27:47 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
4041
4042 * diff.c (usage): Mention -D.
4043
4044 * ifdef.c (print_ifdef_hunk): Write comments on #else and #endif.
4045
4046Sun Oct 29 16:41:07 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
4047
4048 * diff.c (compare_files): Don't fflush for identical files.
4049
4050Wed Oct 25 17:57:12 1989 Randy Smith (randy at apple-gunkies.ai.mit.edu)
4051
4052 * diff3.c (using_to_diff3_block): When defaulting lines from
4053 FILE0, only copy up to just under the *lowest* line mentioned
4054 in the next diff.
4055
4056 * diff3.c (fatal): Add \n to error messages.
4057
4058Wed Oct 25 15:05:49 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
4059
4060 * Makefile (tapefiles): Add ChangeLog.
4061
4062Tue Oct 3 00:51:17 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
4063
4064 * diff3.c (process_diff, create_diff3_block): Init ->next field.
4065
4066Fri Sep 29 08:16:45 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
4067
4068 * util.c (line_cmp): Alter end char of line 2, not line 1.
4069
4070Wed Sep 20 00:12:37 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
4071
4072 * Makefile (diff.tar): Expect ln to fail on some files;
4073 copy them with cp.
4074
4075Mon Sep 18 02:54:29 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
4076
4077 * Handle -D option:
4078 * io.c (find_and_hash_each_line): Keep all lines of 1st file.
4079 * diff.c (main): Handle -D option.
4080 (compare_files): Reject -D if files spec'd are directories.
4081 * analyze.c (diff_2_files): Handle OUTPUT_IFDEF case.
4082
4083Fri Sep 1 20:15:50 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
4084
4085 * diff.c (option_list): Rename arg VECTOR as OPTIONVEC.
4086
4087Mon Aug 28 17:58:27 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
4088
4089 * diff.c (compare_files): Clear entire inf[i].stat.
4090
4091Wed Aug 23 17:48:47 1989 Richard Stallman (rms at apple-gunkies.ai.mit.edu)
4092
4093 * io.c (find_identical_ends): Sign was backward
4094 determining where to bound the scan for the suffix.
4095
4096Wed Aug 16 12:49:16 1989 Richard Stallman (rms at hobbes.ai.mit.edu)
4097
4098 * analyze.c (diff_2_files): If -q, treat all files as binary.
4099 * diff.c (main): Detect -q, record in no_details_flag.
4100
4101Sun Jul 30 23:12:00 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
4102
4103 * diff.c (usage): New function.
4104 (main): Call it.
4105
4106Wed Jul 26 02:02:19 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
4107
4108 * diff.c (main): Make -C imply -c.
4109
4110Thu Jul 20 17:57:51 1989 Chris Hanson (cph at kleph)
4111
4112 * io.c (find_and_hash_each_line): Bug fix in context handling,
4113 introduced by last change.
4114
4115Fri Jul 14 17:39:20 1989 Chris Hanson (cph at kleph)
4116
4117 * analyze.c: To make RCS work correctly on files that don't
4118 necessarily end in newline, introduce some changes that cause
4119 diffs to be sensitive to missing final newline. Because
4120 non-RCS modes don't want to be affected by these changes, they
4121 are conditional on `output_style == OUTPUT_RCS'.
4122 (diff_2_files) [OUTPUT_RCS]: Suppress the "File X missing
4123 newline" message.
4124 (build_script) [OUTPUT_RCS]: Cause the last line to compare as
4125 different if exactly one of the files is missing its final
4126 newline.
4127
4128 * io.c (find_and_hash_each_line): Bug fix in
4129 ignore_space_change mode. Change line's length to include the
4130 newline. For OUTPUT_RCS, decrement last line's length if
4131 there is no final newline.
4132 (find_identical_ends) [OUTPUT_RCS]: If one of the files is
4133 missing a final newline, make sure it's not included in either
4134 the prefix or suffix.
4135
4136 * util.c (print_1_line): Change line output routine to account
4137 for line length including the newline.
4138
4139Tue Jun 27 02:35:28 1989 Roland McGrath (roland at hobbes.ai.mit.edu)
4140
4141 * Makefile: Inserted $(archpfx) where appropriate.
4142
4143Wed May 17 20:18:43 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
4144
4145 * diff3.c [USG]: Include fcntl.h.
4146
4147 * diff.h [USG]: New compilation flags HAVE_NDIR, HAVE_DIRECT.
4148
4149Wed Apr 26 15:35:57 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
4150
4151 * dir.c (diff_dirs): Two new args, NONEX1 and NONEX2, say to pretend
4152 nonex dirs are empty.
4153 (dir_sort): New arg NONEX, likewise.
4154 * diff.c (compare_files): Pass those args.
4155 Sometimes call diff_dirs if subdir exists in just one place.
4156
4157Wed Apr 12 01:10:27 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
4158
4159 * io.c (find_identical_ends): Set END0 *after* last char
4160 during backward scan for suffix.
4161
4162Sat Apr 8 15:49:49 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
4163
4164 * diff3.c (using_to_diff3_block): Now find high marks in files 1
4165 and 2 through mapping off of the last difference instead of the
4166 first.
4167
4168 * diff3.c: Many trivial changes to spelling inside comments.
4169
4170Fri Feb 24 12:38:03 1989 Randall Smith (randy at gluteus.ai.mit.edu)
4171
4172 * util.c, normal.c, io.c, ed.c, dir.c, diff.h, diff.c, context.c,
4173 analyze.c, Makefile: Changed copyright header to conform with new
4174 GNU General Public license.
4175 * diff3.c: Changed copyright header to conform with new GNU
4176 General Public license.
4177 * COPYING: Made a hard link to /gp/rms/COPYING.
4178
4179Fri Feb 24 10:01:58 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
4180
4181 * io.c (slurp): Leave 2 chars space at end of buffer, not one.
4182 (find_identical_ends): Special case if either file is empty;
4183 don't try to make a sentinel since could crash.
4184
4185Wed Feb 15 14:24:48 1989 Jay Fenlason (hack at apple-gunkies.ai.mit.edu)
4186
4187 * diff3.c (message) Re-wrote routine to avoid using alloca()
4188
4189Wed Feb 15 06:19:14 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
4190
4191 * io.c (find_identical_ends): Delete the variable `bytes'.
4192
4193Sun Feb 12 11:50:36 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
4194
4195 * io.c (slurp): ->bufsize is nominal amount we have room for;
4196 add room for sentinel when calling xmalloc or xrealloc.
4197
4198 * io.c (find_identical_ends): Do need overrun check in finding suffix.
4199
4200Fri Feb 10 01:28:15 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
4201
4202 * diff.c (main): -C now takes arg to specify context length.
4203 Now -p to show C function name--Damned IEEE!
4204 Fatal error if context length spec'd twice.
4205
4206 * ed.c (print_ed_hunk): Now special treatment only for lines containing
4207 precisely a dot and nothing else. Output `..', end the insert,
4208 substitute that one line, then resume the insert if nec.
4209
4210 * io.c (find_and_hash_lines): When backing up over starting context,
4211 don't move past buffer-beg.
4212
4213 * io.c (find_identical_ends): Use sentinels to make the loops faster.
4214 If files are identical, skip the 2nd loop and return quickly.
4215 (slurp): Leave 1 char extra space after each buffer.
4216
4217 * analyze.c (diff_2_files): Mention difference in final newlines.
4218
4219Wed Jan 25 22:44:44 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
4220
4221 * dir.c (diff_dirs): Use * when calling fcn ptr variable.
4222
4223Sat Dec 17 14:12:06 1988 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
4224
4225 * Makefile: New vars INSTALL and LIBS used in some rules;
4226 provide default defns plus commented-put defns for sysV.
4227
4228Thu Nov 17 16:42:53 1988 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
4229
4230 * dir.c (dir_sort): Open-trouble not fatal; just say # files is -1.
4231 (diff_dirs): If dir_sort does that, give up and return 2.
4232
4233 * diff.c (compare_files): Don't open directories.
4234 Don't close them specially either.
4235 Cross-propagate inf[i].dir_p sooner.
4236
4237Sun Nov 13 11:19:36 1988 Richard Stallman (rms at sugar-bombs.ai.mit.edu)
4238
4239 * diff.h: Declare index, rindex.
4240
4241 * diff.c (compare_files): If comparing foodir with b/f,
4242 use foodir/f, not foodir/b/f.
4243
4244 * diff.c (compare_files): Don't print "are identical" msg for 2 dirs.
4245 Status now 1 if one file is a dir and the other isn't, etc.
4246
4247Thu Nov 3 16:30:24 1988 Randall Smith (randy at gluteus.ai.mit.edu)
4248
4249 * Makefile: Added a define for diff3 to define DIFF_PROGRAM.
4250
4251 * util.c: Added hack to make sure that perror was not called with
4252 a null pointer.
4253
4254 * diff.c: Changed S_IFDIR to S_IFMT in masking type of file bits
4255 out.
4256
4257 * diff3.c: Included USG compatibility defines.
4258
4259 * diff.h: Moved sys/file.h into #else USG section (not needed or
4260 wanted on System V).
4261
4262 * ed.c, analyze.c, context.c: Shortened names to 12 characters for
4263 the sake of System V (too simple not to do).
4264
4265
4266 -----
4267
4268 Copyright (C) 1988-1994, 1997-2002, 2004, 2006, 2009-2011 Free Software
4269 Foundation, Inc.
4270
4271 Copying and distribution of this file, with or without
4272 modification, are permitted provided the copyright notice and this
4273 notice are preserved.
Note: See TracBrowser for help on using the repository browser.