12002-04-05 Paul Eggert <eggert@sic.twinsun.com> 2 3 * NEWS, configure.ac (AC_INIT): Version 2.8.1. 4 5 * configure.ac (AC_HEADER_STDBOOL): Add. 6 (AC_CHECK_HEADERS): Remove stdbool.h. 7 * m4/stdbool.m4: New file. 8 * m4/prereq.m4 (jm_PREREQ_EXCLUDE): 9 Use AC_HEADER_STDBOOL rather than AC_CHECK_HEADERS(stdbool.h). 10 (jm_PREREQ_HASH): Likewise. 11 12 * src/system.h (SSIZE_MAX): Define if limits.h doesn't. 13 14 * src/analyze.c (diff_2_files): Assign PTRDIFF_MAX - 1 to a 15 size_t variable, just in case there's a problem with ptrdiff_t 16 versus size_t. 17 18 * lib/cmpbuf.c (errno): Remove decl; K&R C is no longer supported. 19 Include limits.h. 20 (SIZE_MAX, SSIZE_MAX): Define if standard headers don't. 21 (MIN): New macro. 22 (block_read): Do not attempt to read more than SSIZE_MAX bytes, as the 23 resulting behavior is implementation-defined. Work around bug in 24 Tru64 5.1, which can't read more than INT_MAX bytes at a time. 25 * src/cmp.c (cmp): Use block_read instead of read, to work 26 around Tru64 5.1 bug. 27 * src/diff3.c (read_diff): Likewise. 28 * src/diff3.c: Include cmpbuf.h. 29 30 * THANKS: Add Ulrich Drepper. 31 32 * INSTALLME: Mention GNU texinfo. 33 34 * doc/diff.texi: 35 Use new @copying directive. 36 Put @contents first, not last, since Texinfo now suggests this. 37 Fix bug in -w documentation noted by Karl Berry. 38 Mention links for speedup. 39 New node "Speedups" for future speedups. 40 Just say "Index", not "Concept Index". 41 422002-03-26 Paul Eggert <eggert@twinsun.com> 43 44 * src/Makefile.am: 45 (INCLUDES): Remove this obsolete macro, replacing it with: 46 (AM_CPPFLAGS): New macro. 47 482002-03-26 Albert Chin-A-Young <china@thewrittenword.com> 49 50 * src/Makefile.am (datadir): Remove, as it conflicts with --datadir. 51 522002-03-26 Paul Eggert <eggert@twinsun.com> 53 54 * doc/diff.texi (dircategory GNU packages): Fix typo: a "* " was 55 missing before the menu entry. Bug diagnosed by Adam Heath. 56 Also, put this dircategory after the Individual utilities dircategory, 57 to work around a compatibility problem with Debian install-info. 58 592002-03-24 Eli Zaretskii <eliz@is.elta.co.il> 60 61 * src/io.c (sip): Do not mishandle buffered count when reverting 62 to text mode. 63 642002-03-23 Paul Eggert <eggert@twinsun.com> 65 66 * NEWS, configure.ac (AC_INIT): Version 2.8. 67 * configure.ac (AC_PREREQ): 2.53. 68 * INSTALLME: Upgrade to gettext 0.11.1 and help2man 1.27. 69 70 * doc/diff.texi: Upgrade the description of `patch' to GNU patch 71 2.5.4, and revamp the documentation accordingly. 72 73 * src/diff.c (main): Fix typo that prevented diff -y from working. 74 Bug reported by Mitsuru Chinen. 75 762002-03-15 Paul Eggert <eggert@twinsun.com> 77 78 * lib/c-stack.c (c_stack_die) [!HAVE_SIGINFO_T]: Don't use info. 79 Bug reported by Eli Zaretskii. 80 812002-03-15 Eli Zaretskii <eliz@is.elta.co.il> 82 83 * ms/config.sed: Tweak editing of install-info-am target. 84 852002-03-12 Paul Eggert <eggert@twinsun.com> 86 87 * NEWS, configure.ac (AC_INIT): Version 2.7.10. 88 89 * NEWS: cmp -l -s and cmp -s -l are not allowed. 90 Deprecate diff -h, -H, -L, -P, --inhibit-hunk-merge. 91 92 * configure.ac (jm_PREREQ_HARD_LOCALE): Add. 93 (AM_INIT_AUTOMAKE): Do not distribute shar file. 94 95 * doc/diff.texi (Overview): byte != character. 96 (Detailed Context, Detailed Unified, Alternate Names, diff Options): 97 Do not document diff -L. 98 (Comparing Directories, Making Patches, diff Options): 99 Do not document diff -P. 100 (diff Performance, sdiff Option Summary, diff Options, sdiff Options): 101 Do not document diff -H. 102 (diff Performance, diff Options): Do not document --horizon-lines. 103 (cmp Options): Prefer -b to -c. 104 (cmp Options, diff Options, diff3 Options, patch Options, 105 sdiff Options): Put short options next to the similar long options. 106 Document --help, and use the same wording for --verbose. 107 (diff3 Options): Fix typo in description of -E, which used wrongly used 108 "-e" instead of "-E". 109 110 * lib/hard-locale.c (alloca): Remove. 111 Include stdlib.h if available, for malloc. 112 (hard_locale): Use malloc, not alloca, so that we need not worry about 113 alloca issues. Test for storage allocation failure. 114 115 * m4/prereq.m4 (jm_PREREQ): Add jm_PREREQ_HARD_LOCALE. 116 (jm_PREREQ_HARD_LOCALE): New macro. 117 118 * src/cmp.c (specify_comparison_type): New function. 119 (check_stdout): "indices and codes" -> "byte numbers and values" 120 (main): Detect clashing options. 121 (cmp): Use "byte" rather than "char" if a translation for "byte" 122 is available, even when in the POSIX locale. 123 124 * src/diff.c (option_help_msgid): Do not document -L, -P, 125 --horizon-lines, --inhibit-hunk-merge, -H. 126 * src/diff.h: -L -> --label 127 1282002-03-11 Paul Eggert <eggert@twinsun.com> 129 130 * NEWS, configure.ac (AC_INIT): Version 2.7.9. 131 132 * INSTALLME: Update to autoconf 2.53, automake 1.6, help2man 133 1.25 with patch. 134 135 * configure.ac (AC_INIT): 136 Change package name from diff to diffutils. 137 (AM_INIT_AUTOMAKE): Use new form, with option gnits, 138 rather than old from that duplicated AC_INIT. 139 (AM_MISSING_PROG): Add help2man. 140 (REGEX_MALLOC): Define. 141 (AC_CONFIG_FILES): Add man/Makefile. 142 143 * Makefile.am (AUTOMAKE_OPTIONS): Remove. 144 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove. 145 * lib/Makefile.am (AUTOMAKE_OPTIONS): Likewise. 146 * ms/Makefile.am (AUTOMAKE_OPTIONS): Likewise. 147 * src/Makefile.am (AUTOMAKE_OPTIONS): Likewise. 148 149 * lib/c-stack.c: Include <errno.h> 150 (ENOTSUP): Define if errno.h doesn't. 151 (SA_NODEFER, SA_ONSTACK, SA_RESETHAND, SA_SIGINFO, SIGSTKSZ, 152 _SC_PAGESIZE, ALTERNATE_STACK_SIZE, stack_t, sigaltstack): 153 Remove; we now assume them all when 154 HAVE_XSI_STACK_OVERFLOW_HEURISTIC, so we don't need 155 substitutes. 156 (<ucontext.h>): Include only if HAVE_XSI_STACK_OVERFLOW_HEURISTIC. 157 (alternate_signal_stack): Now of size SIGSTKSZ. 158 (segv_handler): Simplify, under the assumption that 159 HAVE_XSI_STACK_OVERFLOW_HEURISTIC is nonzero. 160 (c_stack_action): Likewise. 161 (exit_failure) [DEBUG]: Initialize to 0, not 1. 162 (recurse, main) [DEBUG]: Remove main args. 163 164 * m4/c-stack.m4 (AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC): Change 165 wording of message. Do not check for stdbool.h or ucontext.h, 166 or for ucontext_t or sigaction or sigaltstack. 167 168 * po/LINGUAS: Add zh_TW. 169 170 * Makefile.am (SUBDIRS): Add man. 171 * man/Makefile.am: New file. 172 * src/cmp.c (usage): Reword for help2man. 173 * src/diff.c (option_help_msgid): Likewise. 174 * src/diff3.c (option_help_msgid, usage): Likewise. 175 * src/sdiff3.c (option_help_msgid, usage): Likewise. 176 Reword for help2man. 177 178 * THANKS: Add email address for Tower. 179 180 * config/config.guess, config/config.sub, config/depcomp, 181 config/install-sh, config/mdate-sh, config/missing, 182 config/mkinstalldirs, config/texinfo.texi: Update 183 to recent version (maintained in other packages). 184 1852002-03-04 Bruno Haible <haible@ilog.fr> 186 187 * m4/gettext.m4 (AM_GNU_GETTEXT): Set LIBINTL and LTLIBINTL to empty if 188 no preinstalled GNU gettext was found. 189 1902002-03-02 Eli Zaretskii <eliz@is.elta.co.il> 191 192 * ms/config.sed: Tweak editing of install-info-am and 193 uninstall-info-am targets, to include 8+3-butchered names of Info 194 files. 195 1962002-02-28 Paul Eggert <eggert@twinsun.com> 197 198 * NEWS, configure.ac (AC_INIT, AM_INIT_AUTOMAKE): Version 2.7.8. 199 200 * doc/diff.texi: Add vr index. 201 Update copyright to 2002. 202 (Standards conformance): New chapter. 203 (Binary): Differing binary files are trouble unless the user asked for 204 brief output. 205 (Detailed Context): Prefer ISO time stamp format in discussion. 206 (Detailed Unified, Pagination): Likewise. 207 (Less Context): Likewise. Also use short option. 208 (Alternate Names): Separate option from arg. 209 (Making Patches): Mention -U 2. 210 (diff Options): Deprecate -LINES, as POSIX 1003.1-2001 does not 211 allow it. 212 213 * INSTALLME: Update advice for Solaris installation problems. 214 We no longer use a test version of gettext. 215 Autoconf test version updated from 2.52f to 2.52h. 216 POSIX 1003.1-2001 patch for Automake. 217 218 * configure.ac (AC__GNU_SOURCE): Add this, 219 replacing AH_VERBATIM of _GNU_SOURCE. 220 (tempname): Use AC_LIBOBJS, not LIBOBJS=, as now required by autoconf. 221 (jm_PREREQ_C_STACK): Add. 222 (AC_CONFIG_FILES): Remove intl/Makefile. 223 (AM_GNU_GETTEXT): Add external arg, from gettext 0.11. 224 225 * lib/c-stack.c, lib/c-stack.h, lib/exitfail.c, lib/exitfail.h, 226 lib/posixver.c, lib/posixver.h, m4/c-stack.m4, m4/gnu-source.m4, 227 po/cs.po, po/ja.po: New files. 228 229 * intl/ChangeLog, intl/Makefile.in, intl/VERSION, 230 intl/bindtextdom.c, intl/config.charset, intl/dcgettext.c, 231 intl/dcigettext.c, intl/dcngettext.c, intl/dgettext.c, 232 intl/dngettext.c, intl/explodename.c, intl/finddomain.c, 233 intl/gettext.c, intl/gettextP.h, intl/gmo.h, intl/hash-string.h, 234 intl/intl-compat.c, intl/l10nflist.c, intl/libgnuintl.h, 235 intl/loadinfo.h, intl/loadmsgcat.c, intl/localcharset.c, 236 intl/locale.alias, intl/localealias.c, intl/localename.c, 237 intl/ngettext.c, intl/os2compat.c, intl/os2compat.h, intl/osdep.c, 238 intl/plural-eval.c, intl/plural-exp.c, intl/plural-exp.h, 239 intl/plural.c, intl/plural.y, intl/ref-add.sin, intl/ref-del.sin, 240 intl/textdomain.c, m4/isc-posix.m4, m4/libtool.m4: Remove. 241 242 * ABOUT-NLS: Update to Gettext 0.11. 243 244 * Makefile.am (SUBDIRS): Remove intl. 245 246 * config/config.guess, config/config.rpath, config/config.sub, 247 config/texinfo.tex, config/depcomp, config/texinfo.tex, 248 lib/tempname.c: Update to latest version from other packages. 249 250 * lib/xalloc.h (xalloc_exit_failure): Remove; subsumed by exit_failure. 251 * lib/xmalloc.c: Include exitfail.h. 252 (xalloc_exit_failure): Remove; subsumed by exit_failure. 253 All uses changed. 254 255 * lib/Makefile.am (noinst_HEADERS): Add c-stack.h, exitfail.h. 256 (libdiffutils_a_SOURCES): Add c-stack.c, exitfail.c, quotesys.c. 257 (INCLUDES): Remove. 258 259 * lib/cmpbuf.h (buffer_lcm): New arg LCM_MAX. 260 * lib/cmpbuf.c: Include errno.h. 261 (errno): Declare if !STDC_HEADERS. 262 Include signal.h. 263 (SA_RESTART): Define if not already defined. 264 Include <inttypes.h>. 265 (PTRDIFF_MAX): Define if not already defined. 266 (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Likewise. 267 (block_read): Accommodate ancient AIX hosts that set errno to EINTR 268 after uncaught SIGCONT. 269 (buffer_lcm): Return a reasonable size if the multiple is too large. 270 New arg LCM_MAX. All callers changed. 271 272 * lib/hard-locale.c: Include "hard-locale.h". 273 (hard_locale): Ignore ENABLE_NLS, since we want to operate on 274 locales other than LC_MESSAGES. 275 276 * m4/prereq.m4 (jm_PREREQ): Add jm_PREREQ_POSIXVER. 277 (jm_PREREQ_POSIXVER): New macro. 278 279 * m4/setmode.m4 (AC_FUNC_SETMODE_DOS): 280 Check for fcntl.h and unistd.h unconditionally. 281 Suggested by Bruno Haible. 282 283 * po/LINGUAS: Add cs, ja. 284 * po/POTFILES.in: Add lib/c-stack.c, src/dir.c. 285 286 * src/Makefile.am (datadir): @DATADIRNAME@ -> share. 287 (INCLUDES): Remove intl. 288 (LDADD): Change INTLLIBS to LIBINTL. 289 No longer need to link libdiffutils.a twice. 290 291 * src/analyze.c (diff_2_files): 292 Avoid arithmetic overflow in buffer size calculation. 293 294 * src/cmp.c: Include c-stack.h, exitfail.h. 295 (hard_locale_LC_MESSAGES): Depend on ENABLE_NLS. 296 (try_help, check_stdout, main, cmp): 2 -> EXIT_TROUBLE. 297 (main): Check for stack overflow. 298 0 -> EXIT_SUCCESS. 299 1 -> EXIT_FAILURE. 300 (cmp): Likewise. 301 Accommodate ancient AIX hosts that set errno to 302 EINTR after uncaught SIGCONT. 303 304 * src/context.c (pr_context_hunk): 305 Do not dump core if an enormous context causes an 306 arithmetic overflow. 307 (pr_unidiff_hunk): Likewise. 308 (find_hunk): Likewise. 309 310 * src/diff.h: unsigned -> unsigned int. 311 * src/diff.c: Include c-stack.h, exitfail.h. 312 Do not include signal.h. 313 (specify_style, specify_value): Bring these routines back, as POSIX 314 requires that the order of options not matter. 315 (shortopts): New constant. 316 (group_format_option, line_format_option): New constants. 317 (main): 0 -> EXIT_SUCCESS, 1 -> EXIT_FAILURE, 2 -> EXIT_TROUBLE. 318 Ensure that order of options does not matter. 319 Check for stack overflow. 320 If contexts overflow, substitute LIN_MAX, as that's good enough. 321 If multiple contexts are specified, use their maximum. 322 -c is equivalent to -C 3 now, instead of having an implicit context; 323 likewise for -u and -U 3. 324 Use specify_style and specify_value. 325 (SIGCHLD): Do not define; now done in a header. 326 Use new style time stamp format for -u / -U. 327 Reject numeric-string options if operating in POSIX 1003.1-2001 mode. 328 Avoid overflow problems with tab width. 329 Simplify from-file and to-file code. 330 (usage): Do not mention obsolete options. 331 (filetype): Do not mention whether a file is executable. 332 Add typed memory objects. 333 (compare_files): 0 -> EXIT_SUCCESS, 1 -> EXIT_FAILURE, 2 -> 334 EXIT_TROUBLE. 335 336 * src/diff3.c: Include c-stack.h, exitfail.h. 337 (ALLOCATE): Remove. All uses changed to xmalloc, or to xmalloc plus 338 an overflow check. 339 (myread): Remove. 340 (main): Check for stack overflow. 341 0 -> EXIT_SUCCESS, 1 -> EXIT_FAIULRE, 2 -> EXIT_TROUBLE. 342 (try_help): Likewise. 343 (process_diff): Check for integer overflow, to avoid core dumps. 344 2 -> EXIT_TROUBLE. 345 (read_diff): Exit with status 126 if the file is not executable, 346 for compatibility with POSIX 1003.1-2001. 347 Accommodate ancient AIX hosts that set errno to EINTR after uncaught 348 SIGCONT. 349 Check for integer overflow to avoid core dumps. 350 (fatal, perror_with_exit): 2 -> EXIT_TROUBLE. 351 352 * src/dir.c (dir_read): 353 Ignore st_size of directories: POSIX says it's garbage. 354 Check for integer overflow to avoid core dumps. 355 (diff_dirs): 0 -> EXIT_SUCCESS, 2 -> EXIT_TROUBLE. 356 357 * src/ifdef.c: Include <xalloc.h>. 358 (format_group, print_ifdef_lines): Avoid core dumps with bad formats. 359 (do_printf_spec): Avoid alloca. 360 361 * src/io.c (sip): 362 Avoid integer overflow and core dumps if buffer alignments are 363 preposterously incompatible. 364 (slurp): Do not dump core if the file is growing as we read it. 365 If a regular file grows, keep reading until we catch up with its EOF. 366 (find_and_hash_each_line): Check for integer overflow to avoid cores. 367 (GUESS_LINES): Remove. 368 (guess_lines): New function. Avoid integer overflow. 369 (find_identical_ends): Use it. 370 Avoid integer overflow and possible core dumps. 371 372 * src/sdiff.c: Include c-stack.h, exitfail.h. Do not include signal.h. 373 0 -> EXIT_SUCCESS, 1 -> EXIT_FAILURE, 2 -> EXIT_TROUBLE. 374 (ck_editor_status): New function. 375 (main): Check for stack overflow. 376 Adopt POSIX convention for subsidiary programs not found. 377 (diffarg): Check for integer overflow to avoid core dumps. 378 (trapsigs): Remove SA_INTERRUPT special case; now done by header. 379 (SIGCHLD): Likewise. 380 (edit): Adopt POSIX convention for subsidiary programs not found. 381 382 * src/side.c: unsigned -> unsigned int. 383 384 * src/system.h: Don't use alloca or include <alloca.h>. 385 unsigned -> unsigned int 386 (EXIT_SUCCESS, EXIT_FAILURE, EXIT_TROUBLE): Define if not defined. 387 Include signal.h. 388 (SA_RESTART): Define if not defined. 389 (SIGCHLD): Likewise. 390 391 * src/util.c: 2 -> EXIT_TROUBLE. 392 Adopt POSIX convention for ENOEXEC and exit status 126. 393 unsigned -> unsigned int 394 3952002-01-24 Paul Eggert <eggert@twinsun.com> 396 397 * NEWS, configure.ac (AC_INIT, AM_INIT_AUTOMAKE): Version 2.7.7. 398 399 * intl/plural.c: Regenerate with Bison 1.31. 400 401 * ABOUT-NLS, intl/*: Update to Gettext 0.11-pre5++. 402 * INSTALL: Update to Autoconf 2.52f. 403 404 * INSTALLME: New file. 405 * Makefile.am (EXTRA_DIST): Add config/config.rpath, INSTALLME. 406 (DISTCLEANFILES): Remove. 407 * NEWS: Reformat for imminent 2.8 release. 408 * README: Mention INSTALLME. 409 * README-alpha: Move most of contents to INSTALLME. 410 * THANKS: Add Bruno Haible, Jim Meyering, and Eli Zaretskii. 411 412 * config: New subdirectory, containing the following files from .: 413 config.guess, config.sub, depcomp, missing, install-sh, mkinstalldirs. 414 Move the following files here from doc: texinfo.tex, mdate-sh. 415 * config/config.guess, config/config.sub, config/texinfo.tex: 416 Update to latest version from FSF. 417 * config/config.rpath: New file, from Gettext 0.11-pre5++. 418 419 * configure.ac (AC_INIT): Use new 3-arg form. 420 (AC_CONFIG_SRCDIR): Specify src/diff.c here, not in AC_INIT. 421 (ALL_LINGUAS): Remove: now in po/LINGUAS as per Gettext 0.11. 422 (AC_CONFIG_AUX_DIR): New macro invocation. 423 424 * lib/Makefile.am (noinst_HEADERS): Add gettext.h. 425 * lib/gettext.h: New file, from Gettext 0.11-pre5++. 426 * lib/prepargs.c: Include <string.h>. Reported by Bruno Haible. 427 428 * m4/codeset.m4, m4/gettext.m4, glibc21.m4, iconv.m4, isc-posix.m4, 429 lcmessage.m4, progtest.m4: Upgrade to Gettext 0.11-pre5++. 430 * m4/lib-ld.m4, m4/lib-link.m4, m4/lib-prefix.m4: New files, from 431 Gettext 0.11-pre5++. 432 433 * po/LINGUAS: New file. 434 * po/Makefile.in.in: Upgrade to Gettext 0.11-pre5++. 435 * po/Makevars, po/Rules-quot, po/boldquot.sed: New files, 436 from Gettext 0.11-pre5++. 437 438 * src/cmp.c (copyright_string): Update to 2002. 439 * src/diff.c (copyright_string): Likewise. 440 * src/diff3.c (copyright_string): Likewise. 441 * src/sdiff.c (copyright_string): Likewise. 442 443 * src/cmp.c (bytes, parse_ignore_initial, cmp): Use UINTMAX_MAX 444 instead of (uintmax_t) -1, to avoid warnings on some compilers. 445 * src/io.c (file_block_read): Likewise, for SIZE_MAX. 446 447 * src/cmp.c (usage): Reformat messages to ease translation. 448 * src/diff3.c (usage): Likewise. 449 * src/sdiff.c (usage): Likewise. 450 451 * src/diff3.c (main): Remove unused variable. 452 453 * src/dir.c: Include <setjmp.h> 454 (struct dirdata): New member nnames. 455 (locale_specific_sorting, failed_strcoll): New vars. 456 (dir_read): Renamed from dir_sort. Don't sort the dir. 457 Set new nnames member of struct dirdata. All callers changed. 458 (compare_names): Don't check for errno after strcasecmp. 459 Use strcoll only if locale_specific_sorting is nonzero. 460 If strcoll fails, longjmp out rather than returning a value 461 that might result in an invalid comparison function that might 462 make qsort dump core. 463 (diff_dirs): Sort the directory ourselves. Use setjmp to recover 464 from strcoll failure, falling back on native byte comparison. 465 Make local variables volatile if they need to preserve their value 466 after setjmp/longjmp. 467 468 * src/sdiff.c (handler_index_of_SIGINT, handler_index_of_SIGPIPE): 469 New macros. 470 (main): Do not confuse signal numbers with their indices. 471 Bug reported by Bruno Haible. 472 (edit): Cat lin to long before printing with %ld, since lin might 473 be narrow than long. 474 475 * src/system.h (UINTMAX_MAX): New macro. 476 Include gettext.h, not libgettext.h. 477 (N_): Do not wrap arg in parentheses. Fix from Bruno Haible. 478 479 * src/util.c (finish_output): Ensure that werrno is initialized. 480 (lines_differ): Have an explicit do-nothing case for 481 IGNORE_NO_WHITE_SPACE, to pacify gcc -Wall. 482 4832001-12-29 Eli Zaretskii <eliz@is.elta.co.il> 484 485 * src/sdiff.c (interact): After extracting rlen from the editor 486 command, test for a terminating null character, not for a newline. 487 488 * ms/config.bat: Allow longer source directory names without 489 overflowing the line length limits. Create the cache in the 490 build directory, not in the source directory 491 * ms/config.sed: Fix AC_CONFIG_LINKS for when symlinks are 492 unavailable. 493 4942001-12-23 Paul Eggert <eggert@twinsun.com> 495 496 * NEWS, configure.ac (AM_INIT_AUTOMAKE): Version 2.7.6. 497 498 * configure.ac (ALL_LINGUAS): Add tr. 499 500 * src/util.c (begin_output): 501 Have child exit with status 127 rather than reporting 502 failure on its own. Set errno to 0 before invoking popen. 503 (finish_output): Report errno on pclose failure. 504 Distinguish between subsidiary program not found, and failure. 505 506 * src/sdiff.c (not_found, execdiff): Remove. 507 (DIFF_PROGRAM_OPTION): New constant. 508 (longopts, option_help_msgid, main): Add --diff-program=PROGRAM. 509 (check_stdout): New function. 510 (main): Remove DIFF_PROGRAM. Check stdout after printing version. 511 Use check_stdout after printing help. Use execvp/perror_fatail rather 512 than execdiff. Set errno to 0 before invoking popen. 513 Check for pclose failure properly. 514 (main, edit): If child exec fails, exit with 127 rather than trying to 515 print diagnostic. 516 Distinguish between subsidiary program failing and not being found. 517 (edit): Handle signals the same way, regardless of whether we're using 518 system or fork+exec. Check for system returning -1. 519 520 * src/diff3.c (DIFF_PROGRAM_OPTION, HELP_OPTION): New constants. 521 (longopts, main): Use them. 522 (longopts, main, option_help_msgid): New option --diff-option=PROGRAM. 523 (main): Remove DIFF_PROGRAM support. 524 Check stdout after printing version. 525 (check_stdout): Report errno info if fclose fails. 526 (read_diff): Have child exit with status 127 when program is not found, 527 rather than trying to have the child report failure. Check for 528 pclose returning -1. 529 530 * src/diff.c (DEFAULT_WIDTH): Remove. 531 (main): Use 130 instead of DEFAULT_WIDTH, since it's not really 532 builder-settable. Do not prepend DIFF_OPTIONS. 533 (check-stdout): If fclose (stdout) fails, print errno info. 534 (option_help_msgid): Default context is 3, not 2. 535 (usage): Work even if ptrdiff_t is wider than int. 536 537 * doc/diff.texi (diff Options): Remove DIFF_OPTIONS. 538 (Invoking diff3, Invoking sdiff): Remove DIFF_PROGRAM. 539 (diff3 Options, sdiff Options): Add --diff-program. 540 541 * src/cmp.c (valid_suffixes): 542 Add '0', to support suffixes like "MB" and "MiB". 543 (check_stdout): Don't assume that the translations of "write failed" 544 and of "standard output" lack '%'. 545 (main): Check stdout after printing version. 546 547 * lib/setmode.c: [HAVE_FCNTL_H && HAVE_SETMODE_DOS]: Include <fcntl.h>. 548 [!HAVE_SETMODE_DOS]: Do not include <unistd.h>. 549 (set_binary_mode): Return mode (not 1) if fd is a tty. 550 Do not assume that O_TEXT is zero. 551 552 * doc/diff.texi (cmp Options): 553 In byte counts, a plain suffix (without any integer) 554 is assumed to modify the integer 1. Index terms like "kibibyte". 555 Document plain "k". 556 557 (Reporting Bugs): Mention bug-report archive and test version 558 location. Ask for "diff --version" in bug reports. 559 5602001-12-13 Paul Eggert <eggert@twinsun.com> 561 562 * src/diff.c (DEFAULT_WIDTH): Remove; couldn't be changed without 563 also changing option_help_msgid. All uses replaced with 130. 564 565 * lib/setmode.c: Include fcntl.h and unistd.h only if 566 HAVE_SETMODE_DOS. 567 (setmode): Assume a file is binary unless the mode is O_TEXT. 568 * ms/README: Fix minor typos. 569 5702001-12-13 Eli Zaretskii <eliz@is.elta.co.il> 571 572 * ms/README: New file. 573 574 * lib/setmode.c (set_binary_mode) [HAVE_SETMODE_DOS]: Don't assume 575 O_TEXT has a zero value. If FD is a terminal device, do nothing 576 and return MODE, thus pretending that it was already in the 577 requested MODE. 578 [HAVE_FCNTL_H]: Include fcntl.h (needed for O_BINARY). 579 580 * ms/config.sed: Remove the split prevention of config.status. 581 Fix Sed commands for converting absolute file names into 582 top_srcdir-relative ones. 583 584 * ms/config.bat: Fix typos. 585 5862001-12-12 Neal H Walfield <neal@cs.uml.edu> 587 588 * diff.c (option_help_msgid): Correct the default context width 589 from 2 to 3. 590 5912001-12-11 Paul Eggert <eggert@twinsun.com> 592 593 * m4/Makefile.am.in: Remove jm-glibc-io.m4 594 595 * NEWS, configure.ac (AM_INIT_AUTOMAKE): Version 2.7.5. 596 597 * configure.ac (PR_PROGRAM): Use AC_DEFINE_UNQUOTED, so that 598 $PR_PROGRAM is expanded by sh. 599 (ptrdiff_t, ssize_t): Use AC_CHECK_TYPE with a default of int, 600 not AC_CHECK_TYPES. 601 (jm_AC_DOS, AC_FUNC_SETMODE_DOS): New macros. 602 (AC_CONFIG_FILES): Add ms/Makefile. 603 604 * doc/diff.texi: Add --no-ignore-file-name-case. 605 File name case sensitivity now affects file name exclusion. 606 Fix typos. 607 608 * src/util.c: Include dirname.h. 609 (dir_file_pathname): Use base_name rather than file_name_lastdirchar. 610 611 * src/system.h (S_IXUSR, S_IXGRP, S_IXOTH): New macros. 612 Include <libgettext.h> rather than rolling it ourselves. 613 (file_name_lastdirchar, HAVE_SETMODE, set_binary_mode): Remove. 614 615 * src/sdiff.c: Include <dirname.h>. 616 (expand_name): Use base_name rather than file_name_lastdirchar, for 617 portability to DOS. 618 (main): Initialize xalloc_exit_failure before possibly invoking 619 any memory allocator. 620 621 * src/io.c: Include setmode.h. 622 623 * src/diff3.c (main): 624 Initialize xalloc_exit_failure before possibly invoking any memory 625 allocator. 626 627 * src/diff.c: Include dirname.h, setmode.h. 628 629 (main): Later values and/or styles now silently override earlier. 630 (specify_value, specify_style): Likewise. All callers changed. 631 Remove. 632 (binary, main, option_help_msgid, compare_files): 633 HAVE_SETMODE -> HAVE_SETMODE_DOS. 634 (NO_IGNORE_FILE_NAME_CASE_OPTION): New constant. 635 (longopts, main, option_help_msgid): Support it. 636 (exclude_options): New function. 637 (main): Use it. Initialize xalloc_exit_failure before potentially 638 allocating memory. 639 640 (filetype): Distinguish executable files from others, as POSIX 641 suggests. 642 643 (compare_files): Use base_name instead of file_name_lastdirchar. 644 645 * src/cmp.c: Include <hard-locale.h>, <setmode.h>. 646 (hard_locale_LC_MESSAGES): New macro. 647 (sprintc): Remove int width arg; it's now the caller's responsibility 648 to pad. All callers changed. 649 (stat_buf): New static var; was formerly a local var in 'main'. 650 (valid_suffixes): Add 'K', for 'KiB'. 651 (option_help_msgid): Don't confuse bytes with characters. 652 (main): Set xalloc_exit_failure before invoking anything that might 653 allocate memory. Fix bug: -n was incorrectly ignored when optimizing 654 the case of regular files with different lengths. 655 (cmp): Use an index column wide enough to store this comparison's 656 indexes. In locales other than the POSIX locale, say "byte" 657 rather than "char". 658 659 * ms/config.bat: pc -> ms 660 661 * ms/Makefile.am, m4/setmode.m4, lib/setmode.c, lib/setmode.h: 662 New file. 663 664 * lib/Makefile.am (noinst_HEADERS): Add dirname.h, setmode.h. 665 (libdiffutils_a_SOURCES): Add basename.c, setmode.c. 666 667 * Makefile.am (SUBDIRS): Add ms. 668 6692001-12-10 Paul Eggert <eggert@twinsun.com> 670 671 * m4/fnmatch.m4: Test for FNM_CASEFOLD. 672 6732001-12-03 Paul Eggert <eggert@twinsun.com> 674 675 * lib/posix/regex.h: Fix copyright notice. 676 6772001-12-03 Paul Eggert <eggert@twinsun.com> 678 679 * NEWS, configure.ac (AM_INIT_AUTOMAKE): Version 2.7.4. 680 681 * diff.texi (direntry, Overview, Comparison, Binary, Invoking cmp): 682 Use "byte" rather than "character" when talking about cmp, since 683 it compares bytes, not character. 684 (Invoking cmp): New trailing operands FROM-SKIP and TO-SKIP. 685 -i or --ignore-initial now accepts FROM-SKIP:TO-SKIP. 686 New option -n or --bytes. 687 Count operands now may be in octal or hex, and may be followed by a 688 size multiplier. 689 690 * configure.ac (DEFAULT_DIFF_PROGRAM): 691 Define to "diff", not "$bindir/diff" (which didn't work anyway). 692 (AC_CHECK_MEMBERS): Add struct stat.st_blksize, struct stat.st_rdev. 693 (AC_STRUCT_ST_BLKSIZE, AC_STRUCT_ST_RDEV): Remove; obsolescent. 694 (AC_FUNC_FORK): Use this, instead of obsolescent AC_FUNC_VFORK. 695 (AC_CONFIG_FILES, AC_CONFIG_COMMANDS): Add. 696 (AC_OUTPUT): Remove args; they were obsolescent. 697 698 * util.c (setup_output, begin_output, finish_output): 699 HAVE_FORK -> HAVE_WORKING_FORK || HAVE_WORKING_VFORK. 700 * sdiff.c (diffpid, cleanup, main, edit): Likewise. 701 * diff3.c (read_diff): Likewise. 702 703 * system.h (STAT_BLOCKSIZE): 704 Use HAVE_STRUCT_STAT_ST_BLKSIZE, not HAVE_ST_BLKSIZE. 705 (vfork): New macro. 706 (HAVE_FORK): Remove. 707 (set_binary_mode): New macro. 708 709 * sdiff.c (main): HAVE_VFORK -> HAVE_WORKING_VFORK. 710 (edit): Reopen the temporary file after the editor has run, in case 711 the editor operates by unlinking the old file and linking a new one. 712 (P_tmpdir): Rename from PVT_tmpdir; this fixes a typo. 713 All uses changed. 714 715 * io.c (sip, read_files): 716 Remove tests for HAVE_SETMODE; use set_binary_mode 717 instead of setmode. 718 (sip): Fix typo in backward lseek when reverting to text mode. 719 720 * config.site, config.sed, config.bat: New file. 721 722 * Makefile.am (EXTRA_DIST): Add xstrtol.c. 723 (noinst_HEADERS): Add xstrtol.h. 724 (libdiffutils_a_SOURCES): Add xstrtoumax.c. 725 726 * cmp.c: <xstrtol.h>: Include. 727 (ignore_initial): Now an array with 2 elements. All uses changed. 728 (bytes): New var. 729 (HELP_OPTION): New constant. 730 (long_options, main): Use it. 731 (long_options, option_help_msgid, main, cmp): 732 Add support for -n or --bytes. 733 (parse_ignore_initial): New function. 734 (option_help_msgid, main): Add -i M:N. 735 (usage, main): Add two optional trailing operands, a la BSD. 736 (main): setmode -> set_binary_mode. 737 (cmp): Report byte number of what we've seen, not of the entire file. 738 This is to be consistent with the line number, which is always relative 739 with what we've seen. 740 7412001-12-02 Paul Eggert <eggert@twinsun.com> 742 743 * diff.c (main, compare_files): setmode -> set_binary_mode. 744 745 * xstrtol.c (__xstrtol): Don't accept 'Ki'; require 'KiB'. 746 747 * xstrtol.c (__xstrtol): Add support for IEC 60027-2. 748 7492001-11-25 Paul Eggert <eggert@twinsun.com> 750 751 * NEWS, configure.ac (AM_INIT_AUTOMAKE): Version 2.7.3. 752 753 * README-alpha: New file. 754 755 * src/Makefile.am (INCLUDES): Add -I../lib, for regex.h. 756 757 * configure.ac: 758 Don't set LIB_CLOCK_GETTIME to 'none required'; set it to 759 the empty string instead. 760 761 * lib/Makefile.am (EXTRA_DIST): Add strtoimax.c, strtol.c. 762 763 * Makefile.am (SUBDIRS): Put intl before lib, so that libintl.h exists. 764 765 * lib/Makefile.am (noinst_HEADERS): Add unlocked-io.h. 766 767 * configure.ac (__EXTENSIONS__): New define, for the unlocked macros. 768 769 * README: Add copyright notice. 770 Remove stuff that doesn't apply any more. 771 772 * doc/diff.texi: offsets -> indices for cmp 773 774 * src/cmp.c (option_help_msgid): offsets -> indices 775 776 * src/diff.c (option_help_msgid): 777 Don't mention --binary on POSIX hosts. 778 779 * src/sdiff.c (STRIP_TRAILING_CR_OPTION): New constant. 780 (longopts, option_help_msgid, main): Add -E, --ignore-tab-expansion, 781 --strip-trailing-cr. 782 783 * doc/diff.texi: Change direcategory from Utilities to GNU Packages. 784 Add individual utilities. 785 Switch to Free Documentation License. 786 @code -> @command 787 @samp -> @option 788 GNU -> @sc{gnu} 789 Expand tabs to spaces, except when in an example that actually 790 uses tabs. 791 Prefer @node with just one arg. 792 Document -E or --ignore-tab-expansion, --strip-trailing-cr, 793 --ignore-file-name-case. 794 Regular expressions are now grep style, not Emacs style. 795 cmp's -c or --print-chars option is now -b or --print-bytes. 796 Time stamps now depend on LC_TIME. 797 -p now implies ^[[:alpha:]$_]. 798 Flags now include ' and 0. 799 cmp -i is an alias for --ignore-initial 800 Document --from-file, --to-file. 801 Document DIFF_OPTIONS. 802 803 * configure.ac (AC_CHECK_FUNCS): Add gettimeofday, clock_gettime. 804 (LIB_CLOCK_GETTIME): New subst. 805 806 * src/system.h: Assume C89 or better. 807 (_GNU_SOURCE): Remove; config.h now defines it. 808 (alloca): Declare like coreutils does it. 809 (verify, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, O_RDWR, 810 S_IRUSR, S_IWUSR): New macros. 811 (STAT_BLOCKSIZE): Parenthesize definiens. 812 <inttypes.h>: Include if HAVE_INTTYPES_H. 813 (CHAR_MAX, INT_MAX): Remove. 814 (PTRDIFF_MAX, SIZE_MAX): New macros. 815 (strtoumax): New decl. 816 Include stddef.h. 817 (bzero): Remove. 818 (bindtextdomain, textdomain, N_): New macros. 819 (ISPRINT, ISSPACE): Remove ifndef wrappers. 820 (ISUPPER, ISDIGIT): Remove. 821 (TOLOWER): New macro. 822 (MIN): Renamed from min; all callers changed. 823 (MAX): Likewise, from max. 824 (lin): New type. 825 (LIN_MAX): New macro. 826 (file_name_cmp): Renamed from filename_cmp. All callers changed. 827 (file_name_lastdirchar): Renamed from file_name_lastdirchar. 828 All callers changed. 829 (could_be_mvfs_stat_bug, could_be_nfs_stat_bug, 830 dev_may_have_duplicate_ino): Remove. 831 (HAVE_SETMODE, NULL_DEVICE): New macros. 832 (same_file): Do not check attributes. 833 (same_file_attributes): New macro. 834 835 * src/util.c: Assume C89 or better. 836 int -> bool for booleans. 837 int -> lin for line numbers. 838 int -> size_t for sizes. 839 Use angle-brackets when including quotesys.h. 840 Include error.h, regex.h, xalloc.h. 841 (message5): sizeof -> offsetof 842 (begin_output): Invoke pr without -f. 843 (lines_differ): Renamed from line_cmp, and return bool not 3-way int. 844 All callers changed. 845 Add support for IGNORE_TAB_EXPANSION. 846 (change_letter): Now an array rather than a function. All 847 callers changed. 848 (translate_range): Translate line numbers to long, not lin, 849 for convenience with printf. 850 (analyze_hunk): Return enum changes instead of a count of 851 inserts and deletes. All callers changed. 852 (zalloc): New function. 853 854 * src/side.c: Assume C89 or better. 855 int -> bool for booleans. 856 int -> lin for line numbers. 857 858 * src/sdiff.c: Assume C89 or better. 859 int -> bool for booleans. 860 int -> lin for line numbers. 861 Use angle-brackets when including getopt.h, quotesys.h. 862 Include error.h, freesoft.h, stdio.h, xalloc.h. 863 (copyright_string): Use only most recent year. 864 (authorship_msgid, option_help_msgid): Wrap in N_(). 865 866 (tmpname): Now volatile. 867 (tmpmade): Remove. 868 (tmp): New var. 869 (private_tempnam, exists, letters): Remove. 870 (temporary_file): New function. 871 (edit): Use it. 872 (interact): Use strtoumax, not atoi. 873 874 * src/normal.c: Assume C89 or better. 875 int -> lin for line numbers. 876 877 * src/io.c: Assume C89 or better. 878 int -> bool for booleans. 879 int -> lin for line numbers. 880 int -> size_t for sizes. 881 Use angle-brackets when including cmpbuf.h. 882 Include regex.h, xalloc.h. 883 (word): Remove; now done in system.h. 884 (hash_value): New type; use it instead of 'unsigned' for hash values. 885 (file_block_read): New function. 886 (sip, slurp): Use it. Now static. 887 (sip): Ensure block size is a multiple of word size. Clear eof flag. 888 (slurp): Use xalloc_die to report memory exhaustion. 889 (find_and_hash_each_line): Use TOLOWER instead of _tolower. 890 Add support for IGNORE_TAB_EXPANSION. 891 (prepare_text_end): Strip trailing CR if requested. 892 (find_identical_ends): Prepare the text only once, 893 if they're duplicates. 894 Let the compiler take advantage more of the fact that the buffers are 895 word-aligned. 896 (primes): Remove. 897 (prime_offset): New var. 898 (read_var): Use prime_offset instead of primes. 899 Use zalloc instead of xmalloc + bzero. 900 901 * src/ifdef.c: Assume C89 or better. 902 int -> lin for line numbers. 903 (format_group): Use strtoumax to parse line numbers. 904 (format_group, print_ifdef_lines): Use do_printf_spec to 905 handle printf specs. 906 (groups_letter_value): Don't use _tolower; it's locale-dependent. 907 (do_printf_spec): Renamed from scan_printf_spec; now does the printing. 908 909 * src/ed.c: Assume C89 or better. 910 int -> lin for line numbers (or 'long' when that's more convenient). 911 (print_ed_hunk): Fix bug when handling double-dot inserts. 912 913 * src/dir.c: Assume C89 or better. 914 int -> bool for booleans. 915 Include error.h, exclude.h, xalloc.h. 916 917 (dir_sort): Return 0 on error, 1 on success. All callers changed. 918 compare_names -> compare_names_for_qsort. 919 920 (compare_names): Try strcasecmp if ignore_file_name_case. Then try 921 strcoll. Use file_name_cmp only as a last resort. Warn about 922 strcasecmp or strcoll failure. 923 (compare_names_for_qsort): New function. 924 925 (diff_dirs): Use compare_names rather than filename_cmp. 926 927 * src/diff3.c: Assume C89 or better. 928 int -> bool for booleans. 929 int -> lin for line numbers. 930 Use angle-brackets when including getopt.h, quotesys.h. 931 Include error.h, freesoft.h, inttostr.h, xalloc.h. 932 (copyright_string): Use only most recent year. 933 (authorship_msgid, option_help_msgid): Wrap in N_(). 934 935 Rename the following variables for consistency with user-visible 936 option spellings. All uses changed. 937 (text): Renamed from always_text. 938 (initial_tab): Renamed from tab_align_flag. 939 940 (horizon_lines): Remove. Remove all uses. 941 942 (main): Invoke bindtextdomain and textdomain after setlocale. 943 Rename "DIFF" to "DIFF_PROGRAM". 944 945 Try to compare file0 to file1, because this is where changes are 946 expected to come from. Diffing between these pairs of files is more 947 likely to avoid phantom changes from file0 to file1. 948 However, use file2 as the common file if this is a 3-way diff, 949 for backward compatibility. Suggested by Karl Tomlinson. 950 951 (create_diff3_block): Use xcalloc instead of malloc + bzero. 952 953 (INT_STRLEN_BOUND): Remove; now in system.h. 954 955 (read_diff): Always use --horizon-lines=100 rather than trying 956 to guess it. 957 Do not pass --inhibit-hunk-merge. 958 Minimum chunk size is 1, not 8KiB. 959 Use xalloc_die to report memory exhaustion. 960 (undotlines): Use long for start, not int. 961 962 * src/diff.h: Assume C89 or better. 963 int -> bool for booleans. 964 int -> lin for line numbers. 965 Don't include regex.h. 966 (enum changes): New enum. 967 (enum line_class): Remove; subsumed by enum changes. 968 (enum output_style): New constant OUTPUT_UNSPECIFIED. 969 970 (ignore_space_change_flag, ignore_all_space_flag): Remove. 971 (ignore_white_space): New decl, subsuming the above two. All 972 uses changed. 973 974 Rename the following decls for consistency with user-visible 975 option spellings. All uses changed. 976 (text): Renamed from always_text_flag. 977 (ignore_blank_lines): Renamed from ignore_blank_lines_flag. 978 (ignore_case): Renamed from ignore_case_flag. 979 (brief): Renamed from no_details_flag. 980 (initial_tab): Renamed from tab_align_flag. 981 (expand_tabs): Renamed from tab_expand_flag. 982 (starting_file): Renamed from dir_start_file. 983 (paginate): Renamed from paginate_flag. 984 (sdiff_merge_assist): Renamed from sdiff_help_sdiff. 985 (left_column): Renamed from sdiff_left_only. 986 (suppress_common_lines): Renamed from sdiff_skip_common_lines. 987 (speed_large_files): Renamed from heuristic. 988 (minimal): Renamed from no_discards. 989 990 (inhibit_hunk_merge): Remove. 991 992 (strip_trailing_cr, excluded, time_format): New decls. 993 994 (files_can_be_treated_as_binary): Renamed from ignore_some_changes. 995 996 (group_format, line_format): Now char const *[], not char *[]. 997 998 (struct file_data): Buffer is now word*, not char*, as it's always 999 aligned and this can help the compiler. buffered_chars -> buffered 1000 (since it's a byte count, not a char count). All uses changed. 1001 New member `eof'. 1002 1003 (FILE_BUFFER): New macro. 1004 1005 (excluded_filename, error, free_software_msgid): Remove decls; now in 1006 other .h files. 1007 1008 (sip, slurp): Remove decls. 1009 (file_block_read): New decl. 1010 (change_letter): Now an array, not a function. 1011 (lines_differ): Renamed from line_cmp. 1012 (analyze_hunk): Now returns enum changes rather than two change counts. 1013 1014 * src/Makefile.am (diff_LDADD): New symbol. 1015 1016 * src/diff.c: Assume C89 or better. 1017 int -> bool for booleans. 1018 long -> off_t for line numbers. 1019 Use angle-brackets when including getopt.h, fnmatch.h, quotesys.h. 1020 Include error.h, exclude.h, freesoft.h, hard-locale.h, prepargs.h, 1021 regex.h, signal.h, xalloc.h. 1022 (copyright_string): Use only most recent year. 1023 (authorship_msgid, option_help_msgid): Wrap in N_(). 1024 1025 Rename the following variables for consistency with user-visible 1026 option spellings. All uses changed. 1027 (binary): Renamed from binary_flag. 1028 (new_file): Renamed from entire_new_file_flag. 1029 (unidirectional_new_file): Renamed from unidirectional_new_file_flag. 1030 (report_identical_files): Renamed from print_file_same_flag. 1031 1032 (numeric_arg): Remove. 1033 1034 (exclude, exclude_alloc, exclude_count, excluded_filename, add_exclude, 1035 add_exclude_file): 1036 Remove; now done by exclude.h. 1037 1038 (BINARY_OPTION, FROM_FILE_OPTION, HELP_OPTION, HORIZON_LINES_OPTION, 1039 IGNORE_FILE_NAME_CASE_OPTION, INHIBIT_HUNK_MERGE_OPTION, 1040 LEFT_COLUMN_OPTION, LINE_FORMAT_OPTION, NORMAL_OPTION, 1041 SDIFF_MERGE_ASSIST_OPTION, STRIP_TRAILING_CR_OPTION, 1042 SUPPRESS_COMMON_LINES_OPTION, TO_FILE_OPTION, 1043 UNCHANGED_LINE_FORMAT_OPTION, OLD_LINE_FORMAT_OPTION, 1044 NEW_LINE_FORMAT_OPTION, UNCHANGED_GROUP_FORMAT_OPTION, 1045 OLD_GROUP_FORMAT_OPTION, NEW_GROUP_FORMAT_OPTION, 1046 CHANGED_GROUP_FORMAT_OPTION): New constants. 1047 (longopts, main): Use them. 1048 1049 (longopts, main, option_help_msgid): Add -E, --from-file, --to-file. 1050 1051 (main): Invoke bindtextdomain and textdomain after setlocale. 1052 Use grep syntax, not Emacs, for regular expressions. 1053 Use exclude.h, not our own functions. 1054 Use ISO 8601 time format in hard locales. 1055 Prepend DIFF_OPTIONS. 1056 Don't update ignore_some_changes. 1057 Use strtoumax instead of numeric_arg. 1058 Use specify_value when appropriate. 1059 error -> try_help when appropriate. 1060 -p now means ^[[:alpha:]$_], not ^[_a-zA-Z$]. 1061 Ignore --inhibit-hunk-merge. 1062 Prefer changed group formats to unchanged ones. 1063 Remove now-unnecessary casts. 1064 Set files_can_be_treated_as_binary. 1065 1066 (specify_value): Renamed from specify_format. All uses changed. 1067 1068 (specify_style): Default is now unspecified, not normal. All 1069 uses changed. 1070 1071 (set_mtime_to_now): New function. 1072 (compare_files): Use it. Use memset, not bzero. 1073 Set stdin mtime to current time even when stdin is not a regular file. 1074 Check for same file attributes, as well as for same file. 1075 Use files_can_be_treated_as_binary. 1076 "write failed" -> "standard output on output failure. 1077 1078 * src/context.c: Assume C89 or better. 1079 int -> lin for line numbers. 1080 Include inttostr.h, regex.h. 1081 (TIMESPEC_NS): New macro. 1082 (nstrftime): New decl. 1083 (print_context_label): Use nstrftime and time_format to format times. 1084 Print numeric time stamp value if localtime fails. 1085 (print_context_function): New function. 1086 (pr_context_hunk, pr_unidiff_hunk): Use it. 1087 (find_function): Use size_t for sizes, not int. 1088 1089 * src/cmp.c: Assume C89 or better. 1090 int -> bool for booleans. 1091 long -> off_t for line numbers. 1092 Use angle-brackets when including cmpbuf.h, getopt.h. 1093 Include error.h, freesoft.h, inttostr.h, xalloc.h. 1094 (copyright_string): Use only most recent year. 1095 (authorship_msgid): Wrap in N_(). 1096 (buffer): Now word*, not char*. All uses changed. 1097 (word): Remove macro; now in system.h. 1098 (long_options, option_help_msgid, main): -c --print-chars -> 1099 -b --print-bytes 1100 (check_stdout): "write failed" -> "standard output" 1101 (option_help_msgid): Wrap in N_(). 1102 (main): Invoke bindtextdomain and textdomain after setlocale. 1103 Use strtoumax instead of doing the work ourselves. 1104 Check for same_file_attributes as well as same_file. 1105 (cmp): Use ssize_t for read returns, not size_t. 1106 Do not assume that size_t is not narrower than int. 1107 Do not assume that line numbers fit in 'long'. 1108 (block_compare_and_count, block_compare): 1109 Compiler now checks that buffers are word-aligned. 1110 (block_compare_and_count): Count sizes with size_t, not long. 1111 (sprintc): byte arg is unsigned char, not unsigned. 1112 1113 * src/analyze.c: Assume C89 or better. 1114 int -> lin for line numbers. 1115 int -> bool for booleans. 1116 unsigned int -> size_t for sizes. 1117 Use angle-brackets when including cmpbuf.h. 1118 Include error.h, regex.h, xalloc.h. 1119 (discard_confusing_lines, diff_2_files): Use zalloc rather 1120 than xalloc+bzero. 1121 (discard_confusing_lines): unsigned int -> lin for values that 1122 are really line numbers. 1123 (shift_boundaries): Do not inhibit hunk merges. 1124 (build_reverse_script, build_script, diff_2_files): Use |, not ||. 1125 (diff_2_files): no_details_flag & ~ignore_some_changes -> 1126 files_can_be_treated_as_binary. Esure that buffer size is a multiple 1127 of sizeof (word). Use file_block_read to read buffers. 1128 (diff_2_files): Abort if output style is not one of the 1129 expected styles. 1130 11312001-11-23 Paul Eggert <eggert@twinsun.com> 1132 1133 * src/Makefile.am, m4/vararrays.m4: New file. 1134 1135 * m4/prereq.m4 (jm_PREREQ_READUTMP): 1136 Remove, as it gives autoheader the willies. 1137 1138 * m4/README, lib/prepargs.h, lib/prepargs.c, lib/offtostr.c, 1139 lib/umaxtostr.c, lib/inttostr.c, lib/inttostr.h, 1140 lib/imaxtostr.c, lib/freesoft.h: New files. 1141 1142 * lib/freesoft.c: Include config.h, freesoft.h rather than diff.h. 1143 (free_software_msgid): Wrap contents in N_. 1144 1145 * lib/cmpbuf.h: Use prototypes instead of old-style functions. 1146 1147 * lib/cmpbuf.c: 1148 Don't include system.h; instead, include config.h, unistd.h. 1149 Use prototypes instead of old-style functions. 1150 (block_read): Don't assume that int is no wider than size_t. 1151 1152 * lib/Makefile.am, po/POTFILES.in: New file. 1153 11542001-11-22 Paul Eggert <eggert@twinsun.com> 1155 1156 * pc/config.h: 1157 Define filename_cmp as an object-like macro, not as a function-like 1158 macro. 1159 1160 * exgettext: Always operate in the C locale. 1161 Set AWK using a method that works even with broken shells. 1162 1163 * doc/Makefile.am: New file. 1164 1165 * configure.ac (AC_INIT): 1166 Use src/diff.c, not diff.h, as the source files got removed. 1167 (AM_CONFIG_HEADER): Switch from AC_CONFIG_HEADER. 1168 (AC_ARG_PROGRAM, AC_MINIX): Remove. 1169 1170 (AC_PREREQ, AM_INIT_AUTOMAKE, ALL_LINGUAS, AC_PROG_AWK, 1171 AM_PROG_CC_STDC, AC_PROG_RANLIB, AC_C_INLINE, AC_C_VARARRAYS, 1172 DEFAULT_DIFF_PROGRAM, DEFAULT_EDITOR_PROGRAM, 1173 AC_STRUCT_ST_MTIM_NSEC): Add. 1174 1175 (PR_PROGRAM): AC_DEFINE. 1176 1177 (AC_SYS_LARGEFILE): Use instead of our homebrew version. 1178 1179 (_GNU_SOURCE): Define if not defined. 1180 1181 (AC_CHECK_HEADERS): Add stdbool.h, unistd.h. 1182 (AC_CHECK_TYPES): Add ptrdiff_t, uintmax_t. 1183 (AM_GNU_GETTEXT, XGETTEXT): Add. 1184 1185 (WITH_MVFS_STAT_BUG, WITH_NFS_STAT_BUG): Remove. 1186 (HAVE_MEMCHR): Remove. 1187 (AC_CHECK_FUNCS): Add diraccess. 1188 (AC_REPLACE_FUNCS): Add memchr, waitpid. 1189 (jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_GNU_STRFTIME, jm_FUNC_MALLOC, 1190 jm_FUNC_REALLOC, jm_PREREQ_ERROR, jm_PREREQ_QUOTEARG, jm_PREREQ_REGEX, 1191 jm_PREREQ_TEMPNAME, jm_AC_PREREQ_XSTRTOUMAX, AC_FUNC_FNMATCH): Add. 1192 (fnmatch.h, regex.h): Do not create these files unless we're using 1193 our own fnmatch and regex. 1194 1195 (AC_OUTPUT): Add doc/Makefile, intl/Makefile, lib/Makefile, 1196 lib/posix/Makefile, m4/Makefile, po/Makefile.in, src/Makefile. 1197 1198 * Makefile.am: New file. 1199 1200 * po/en_GB.po: Don't translate "program" to "programme". 1201 12022001-11-20 Paul Eggert <eggert@twinsun.com> 1203 1204 * m4/prereq.m4: New file. 1205 12062001-03-16 Paul Eggert <eggert@twinsun.com> 1207 1208 * lib/tempname.c (uint64_t): 1209 Define if not defined, and if UINT64_MAX is not defined. 1210 12112001-02-26 Paul Eggert <eggert@twinsun.com> 1212 1213 * lib/tempname.c: glibc 1.32 1214 12152001-02-17 Paul Eggert <eggert@twinsun.com> 1216 1217 * m4/Makefile.am.in: GNU fileutils 4.1 1218 12192001-01-09 Paul Eggert <eggert@twinsun.com> 1220 1221 * lib/tempname.c (struct_stat64): New macro. 1222 (direxists, __gen_tempname): Use it. This avoids a portability problem 1223 with Solaris 8. 1224 1225 * lib/tempname.c (<config.h>): Include if HAVE_CONFIG_H. 1226 (<stddef.h>, <stdint.h>, <string.h>): 1227 Include only if STDC_HEADERS || _LIBC. 1228 (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC. 1229 (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC. 1230 (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC. 1231 (__set_errno): Define this macro if <errno.h> doesn't. 1232 (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE): 1233 Define these macros if <stdio.h> doesn't. 1234 (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR): 1235 Define these macros if <sys/stat.h> 1236 doesn't. Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN. 1237 (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64, 1238 __xstat64): Define if not _LIBC. 1239 (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC). 1240 (__gen_tempname): Invoke gettimeofday only if HAVE_GETTIMEOFDAY 1241 || _LIBC; otherwise, fall back on plain "time". 1242 Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600. 1243 1244 * lib/mkstemp.c (__GT_FILE): Define to zero if not defined. 1245 12462000-10-25 Paul Eggert <eggert@twinsun.com> 1247 1248 * lib/hard-locale.c: New file. 1249 12502000-02-05 Paul Eggert <eggert@twinsun.com> 1251 1252 * exgettext: From GCC repository 1253 12541999-07-06 Paul Eggert <eggert@twinsun.com> 1255 1256 * lib/mkstemp.c: glibc 2.2 1257 12581998-12-11 Paul Eggert <eggert@twinsun.com> 1259 1260 * src/sdiff.c (lf_snarf): 1261 Fix bug when help line wrapped around the input buffer. 1262 12631998-09-15 Paul Eggert <eggert@twinsun.com> 1264 1265 * diff.texi: Add @dircategory and @direntry. 1266 12671998-09-14 Paul Eggert <eggert@twinsun.com> 1268 1269 * Makefile.in (VERSION): Version 2.7.2. 1270 (DEFAULT_DIFF_PROGRAM): Renamed from DIFF_PROGRAM. 1271 (PR_PROGRAM): All `configure' to define it. 1272 (srcs): Add $(diffutils_srcs), freesoft.c, quotearg.c instead of 1273 quote.c, quotearg.h. 1274 (distfiles): Add acconfig.h, message/*. 1275 (all): Depend on $(destfiles), not info. 1276 (version.c): Parenthesize `GNU diffutils'. 1277 (common_o): Add freesoft.o 1278 (diff_o): quote.o -> quotearg.o 1279 (diff3_o, sdiff_o): Likewise. 1280 (diff.dvi): Depend on version.texi. 1281 (diff.o diff3.o quotearg.o sdiff.o util.o): 1282 New dependency on quotearg.h 1283 (diff3.o): DIFF_PROGRAM -> DEFAULT_DIFF_PROGRAM. 1284 (sdiff.o): Likewise. 1285 (messages.po): Remove. 1286 (message/msgid.po, message/template.po): New rules. 1287 (maintainer-clean): Renamed from realclean. 1288 (install): Install from source directory, if applicable. 1289 Invoke install-info if needed. 1290 (install-strip): New rule. 1291 (check): Set DIFF. 1292 (stamp-h.in): Don't put the date into the timestamp. 1293 (D_dirs): Add $D/message. 1294 ($D.tar.gz): Compress with gzip -9. 1295 Don't use ln to create distribution; it doesn't work with symlinks. 1296 (srcs, distfiles, diff_o, diff3_o, sdiff_o): Rename quotearg.c to 1297 quotesys.c and quotearg.h to quotesys.h. 1298 1299 * configure.in (AC_PATH_PROG): Add PR_PROGRAM. 1300 If available, prefer support for large files unless the user specified 1301 one of the CPPFLAGS, LDFLAGS, or LIBS variables. 1302 (AC_STRUCT_ST_RDEV): Add. 1303 (HAVE_ST_FSTYPE_STRING): Add. 1304 (--with-mvfs-stat-bug, --with-nfs-stat-bug): New options. 1305 (HAVE_MEMCHR): New macro. 1306 (AC_CHECK_FUNCS): Add sicprocmask. 1307 1308 * diff.h (XTERN): Renamed from EXTERN. 1309 (struct filedata): Remove dir_p arg. 1310 (struct comparison): New type. 1311 (diff_2_files, diff_dirs)" Ise ot/ 1312 (error): Add printf attribute if applicable. 1313 (free_software_msgid): New decl. 1314 (pr_program): New decl. 1315 (fatal): Add noreturn attribute. 1316 (pfatal_with_name): Likewise. 1317 1318 * system.h (__attribute__): New macro. 1319 (getenv): Don't declare if HAVE_STDLIB_H. 1320 (CHAR_MAX): New macro. 1321 (<locale.h>): New include. 1322 (<locale.h>): Include before <libintl.h>. 1323 (could_be_mvfs_stat_bug, could_be_nfs_stat_bug, 1324 dev_may_have_duplicate_ino, same_special_file): New macros. 1325 (same_file): Use them. 1326 1327 * cmp.c (authorship_msgid): New var. 1328 (free_software_msgid): New decl. 1329 (error): Now has printf attribute. 1330 (try_help): Likewise. 1331 (long_options): Don't assume ASCII. 1332 (try_help): Now accepts operand arg. 1333 (main): Check for -1, not EOF, when calling getopt_long. 1334 Report --ignore-initial value when complaining about it. 1335 Output copyright and free software info with -v. 1336 Don't assume ASCII. 1337 Report last operand when one is missing. 1338 Report text of extra operand. 1339 Move block_read into cmpbuf.c. 1340 1341 * diff.c (authorship_msgid): New var. 1342 (quotesys.h): Include. 1343 (ck_atoi): Remove. 1344 (function_regexp_list, ignore_regexp_list): Now static. 1345 (binary_flag): Renamed from binary_I_O. 1346 (entire_new_file_flag, unidirectional_new_file_flag, 1347 print_file_same_flag): Now static. 1348 (numeric_arg): Renamed from ck_atoi. 1349 New argument specifying the argument type. 1350 (longopts, main): Don't assume ASCII. 1351 (longopts): Remove old aliases --file-label, --entire-new-file, 1352 --ascii, --print. 1353 (main): Check for -1, not EOF, when calling getopt_long. 1354 Use numeric_arg to report errors. 1355 Report error if -l specified but pagination is not supported. 1356 Report error if -S is specified twice with conflicting values. 1357 Have --version conform to the new GNU standards. 1358 Add new --from-file, --to-file, --inhibit-hun,-merge options. 1359 Make the horizon at least as large as the context. 1360 Add casts to pacify gcc -Wall. 1361 (try_help): Add operand arg. 1362 (option_help_msgid): Doc fix to match above. 1363 (usage): Indent option_help_msgid. 1364 (compare_files): Now takes struct comparison 1365 instead of two directory names and a depth. 1366 (NONEXISTENT, UNOPENED, ERRNO_ENCODE, ERRNO_DECODE): 1367 New macros. 1368 (DIR_P): New macro. 1369 Report error if fflush does. 1370 1371 * cmpbuf.c (block_read): Moved here from cmp.c. 1372 1373 * cmpbuf.h (block_read): New decl. 1374 1375 * io.c (cmpbuf.h): Include. 1376 (slurp): Check for arithmetic overflow when computing buffer size. 1377 1378 * dir.c (diff_dirs): Check for recursive directory loop. 1379 Arg is now struct comparison const *. 1380 (dir_loop): New function 1381 1382 * analyze.c (no_discards): Remove. 1383 (inhibit): Remove. 1384 (shift_boundaries): Don't inhibit. If inhibit_hunk_merge is nonzero, 1385 don't merge hunks. 1386 (briefly_report): Now returns 2 if trouble, CHANGES otherwise. 1387 (diff_2_files): Now takes struct comparison. If briefly_report reports 1388 trouble, pass it on to caller. 1389 1390 * side.c (print_half_line): Add brackets to pacify GCC -Wall. 1391 1392 * sdiff.c (quotesys.h): Include. 1393 (DIFF_PROGRAM, DEFAULT_EDITOR_PROGRAM): Remove. 1394 (free_software_msgid, editor_program, not_found): New vars. 1395 (diffbin, edbin): Remove. 1396 (editor_program): Renamed from edbin. 1397 (edit, interact): Now take extra string arg. 1398 (exiterr, fatal, perror_fatal, try_help): Add noreturn attribute. 1399 (sigset_t, sigemptyset, sigmask, sigaddset, SIG_BLOCK, SIG_SETMASK): 1400 (sigprocmask): New macros, if !HAVE_SIGPROCMASK. 1401 (error): Now has printf attribute. 1402 (longopts, main): Don't assume ASCII. 1403 (try_help): New operand arg. 1404 (usage): Conform to new GNU standards. 1405 (main): Set static vars for editor and diff program. 1406 Compare getopt_long result to -1, not EOF. 1407 -v conforms to new GNU standard. 1408 Complain better about extra and missing operands. 1409 If HAVE_VFORK, block SIGINT and SIGPIPE in the parent, since when 1410 the child munges its handlers it may somp on the parent. 1411 Pass rname to intract. 1412 Translate not-found message before forking. 1413 (give_help): Just output it all at once. 1414 (edit): New args lname, lline, rname, rline. 1415 (edit): New command 'd'. 1416 (interact): New args lname, rname. 1417 1418 * util.c (quotesys.h): Include. 1419 (PR_PROGRAM): New macro. 1420 (pfatal_with_name): Abort if error returns. 1421 (fatal): Likewise. 1422 (print_message_queue): Free message chain after printing. 1423 (currently_recursive): Renamed from current_depth, and now a boolean. 1424 (begin_output): Report error if fflush does. 1425 Avoid stdio and gettext in child. 1426 1427 * diff3.c (quotesys.h): Include. 1428 (free_software_msgid): New decl. 1429 (RANGE_START, RANGE_END): Renamed from START and END. 1430 (fatal, perror_with_exit, try_help): Add noreturn attribute. 1431 (error): Add printf attribute. 1432 (diff_program): Now a ptr, not an array. 1433 Initialize to DEFAULT_DIFF_PROGRAM instead of DIFF_PROGRAM. 1434 (longopts, main): Don't assume ASCII. 1435 (main): Use DIFF environment var to specify name of diff program. 1436 Compare getopt_long result to -1, not EOF. 1437 -v now reports version according to new GNU standard. 1438 Report spelling of extra operand, or last operand before missing one. 1439 (try_help): Now takes operand arg. 1440 (option_help_ms): Fix typo: missing comma. 1441 (usage): Update as per current GNU standards. 1442 (environ): Remove decl. 1443 (read_diff): Invoke diff with --inhibit-hunk-merge. 1444 Translate `not found' message before forking. 1445 Quote name of diff program. 1446 Pass horizon lines. 1447 `memory exhausted' -> `Memory exhausted' 1448 1449 * pc/makefile (%.exe): Remove. 1450 (pc-clean): Remove *.exe 1451 * pc/makefile.sed (DEFAULT_DIFF_PROGRAM): Renamed from DIFF_PROGRAM. 1452 When editing mkinstalldirs rule, look for exec_prefix and prefix. 1453 Add .exe when installing files. 1454 * pc/emx/config.h (same_file): Add. 1455 * pc/config.h (same_file): Remove. 1456 * pc/djgpp/config.h: Adjust to latest patch from eliz. 1457 * pc/djgpp/makefile.sed: Don't alter PROGRAMS. 1458 * pc/pc.c: Update FSF address. 1459 (quote_system_arg): Renamed from system_quote_arg. 1460 1461 * README: Add --with-mvfs-stat-bug, --with-nfs-stat-bug. 1462 1463 * getmsgids: Add copyright date and update FSF address. 1464 1465 * diff.texi: Document recent changes. 1466 The patch doc still corresponds to patch 2.2, unfortunately. 1467 Update GNU bug reporting address. Omit Larry Wall's address; 1468 it's obsolete and he's busy with perl. 1469 1470 * context.c: Fix spacing. 1471 1472 * NEWS: Mention --from-file=FILE, --to-file=FILE, ed. 1473 1474 * acconfig.h, freesoft.c, message/de.po, message/en_UK.po, 1475 message/es.po, message/fr.po, message/pl.po, message/sv.po: 1476 New files. 1477 1478 * ed.c: Remove `#if 0'ed code. 1479 1480 * normal.c, waitpid.c: Update FSF address. 1481 14821998-03-15 Paul Eggert <eggert@twinsun.com> 1483 1484 * quotesys.c: Renamed from quotearg.c. 1485 1486 * quotesys.h: Renamed from quotearg.h 1487 (__QUOTESYS_P): Renamed from __QUOTEARG_P. 1488 14891997-05-05 Paul Eggert <eggert@twinsun.com> 1490 1491 * quotesys.c, quotesys.h: New file. 1492 1493Mon Nov 14 05:10:56 1994 Paul Eggert <eggert@twinsun.com> 1494 1495 Add internationalization support. 1496 Several messages have been changed slightly, 1497 to make them more consistent and easier to translate. 1498 All strings that are messages are passed through gettext once before 1499 being used, so that they can be localized. 1500 Each function and macro whose first parameter is a gettext msgid 1501 has had its first parameter's name changed so it ends in `msgid'. 1502 All arrays of msgids have had their names changed to end in `msgid'. 1503 `getmsgids' uses this to determine which strings are msgids. 1504 1505 * pc/COPYING, pc/INSTALL, pc/config.h, 1506 pc/djgpp/config.h, pc/djgpp/makefile.sed, 1507 pc/emx/config.h, pc/emx/diff.def, pc/emx/gnuregex.def, 1508 pc/emx/makefile.sed, 1509 pc/makefile, pc/makefile.sed, pc/pc.c: New files, for PC support. 1510 1511 * getmsgids: New file. 1512 1513 * Makefile.in (PACKAGE, VERSION, diffutils_srcs, D): New vars. 1514 (version.c, version.texi, messages.po): New files. 1515 messages.po is built automatically from source files and `getmsgids'. 1516 (distfiles): Add them, pc/*, and getmsgids. 1517 (diff.info): Now depends on version.texi. 1518 (realclean): Clean messages.po, version.*. 1519 (dist): Just build $D.tar.gz. 1520 ($D.tar.gz): New file, takes over old `dist' function. 1521 Don't assume $(distfiles) are all in same directory. 1522 1523 * configure.in (AC_CHECK_HEADERS): Add libintl.h, locale.h. 1524 (AC_CHECK_LIB): Check for -lintl. 1525 1526 * analyze.c (briefly_report): Rewrite `message (A?"B":"C")' as 1527 `if (A) message ("B") : message ("C")'; this is for getmsgids. 1528 (briefly_report, diff_2_files): For label, use file_label if set. 1529 * diff.c (compare_files): Likewise. 1530 1531 * system.h (gettext): Declare; use a stub if ! HAVE_LIBINTL_H. 1532 (setlocale): Declare; use a stub if ! HAVE_LOCALE_H. 1533 1534 * cmp.c, diff.c, diff3.c, sdiff.c (main): 1535 Invoke setlocale first thing, to tell library we're internationalized. 1536 (option_help_msgid): New constant. 1537 (usage): Use it, so message is translated one option at a time. 1538 * sdiff (help_msgid, give_help): Likewise. 1539 1540 * cmp.c (sprintc): Renamed from `printc'. 1541 Now outputs to a buffer instead of stdout. 1542 (cmp): Use new sprintc; it's easier to internationalize. 1543 1544 * diff.c (main): -D FOO now outputs `/* ! FOO */ instead of 1545 `/* not FOO */'. 1546 1547 * sdiff.c (version_string): Fix decl typo: `const' was missing. 1548 (trapsigs): Ignore sigaction failure, to be compatible with `signal'. 1549 1550 * util.c (struct msg, message5, print_message_queue): 1551 Allocate just one block of memory to save a message. 1552 1553Wed Nov 9 17:42:44 1994 Paul Eggert <eggert@twinsun.com> 1554 1555 * sdiff.c (trapsigs): Don't check signal return value, since it's 1556 bogus under djgpp. 1557 1558Mon Oct 31 07:27:27 1994 Paul Eggert <eggert@twinsun.com> 1559 1560 * Makefile.in (srcs, diff_o, diff3_o, sdiff_o): 1561 New files quote.c, quote.o. 1562 1563 * diff.h (function_regexp, ignore_regexp): Replace lists of compiled 1564 regexps with these single compiled regexps. All users changed. 1565 (regexp_list,function_regexp_list,ignore_regexp_list): Move to diff.c. 1566 * diff.c (add_regexp): Build one big regexp instead of a regexp list. 1567 (summarize_regexp_list): New function. 1568 (regexp_list): Redesigned struct; moved here from diff.h. 1569 (function_regexp_list, ignore_regexp_list): Likewise, for vars. 1570 1571 * context.c (find_function): Simplify interface: 1572 don't return size of function line. All callers changed. 1573 (print_context_script, find_function): INT_MAX now denotes no 1574 previous match; this is simpler than `- file->prefix_lines - 1'. 1575 1576 * diff3.c (read_diff): Quote arguments with system_quote_arg. 1577 * sdiff.c (main): Use system_quote_arg to compute command. 1578 * diff.c (option_list): Quote options with system_quote_arg. 1579 * util.c (begin_output): Use system_quote_arg to compute command. 1580 1581 * util.c (pr_program): New var. 1582 (analyze_hunk): Fix off-by-1 line length bug. 1583 Match with one big regexp instead of a list of regexps. 1584 Use new `trivial_length' local instead of comparing first byte to `\n'. 1585 Help the compiler with linbuf local vars. 1586 1587 * system.h (system_quote_arg): 1588 New function; replaces SYSTEM_QUOTE_ARG macro. 1589 1590Sat Oct 15 20:09:12 1994 Paul Eggert <eggert@twinsun.com> 1591 1592 * system.h (_tolower): Define if not already defined. 1593 * io.c (find_and_hash_each_line): Change tolower to _tolower; this 1594 speeds up diff -i considerably on some hosts (e.g. Solaris 2.3). 1595 * util.c (line_cmp): Likewise. 1596 * ifdef.c (groups_letter_value): Likewise. 1597 1598 * diff.h (ignore_some_line_changes): Remove. All users changed. 1599 * io.c (find_and_hash_each_line): Don't invoke line_cmp if the length 1600 differs and -i is in force. Don't assume ISSPACE ('\n') is nonzero. 1601 1602 * diff.h (xmalloc_exit_failure): New variable. 1603 All `main' programs set this variable at the start. 1604 xmalloc and xrealloc are now taken from GNU library. 1605 * cmp.c (main): Align buffer size to word size; some mallocs care. 1606 * io.c (slurp): Likewise. 1607 * diff.c (add_exclude): Can now assume xrealloc (0, ...) works. 1608 (add_regexp): Free storage on failure. Allocate storage all at one go. 1609 * system.h (malloc, realloc): Remove unused declarations. 1610 * diff3.c, sdiff.c, util.c (xmalloc, xrealloc): Remove. 1611 * sdiff.c (diffarg): Take advantage of cleaner xrealloc semantics. 1612 1613 * io.c (ROL): Use sizeof to make it more generic. 1614 1615 * Makefile.in (common_o): New variable. 1616 Link error.o and xmalloc.o into all programs. 1617 (check): Depend on $(PROGRAMS). 1618 1619 * diff.h (error): Change to GNU library standard. All callers changed. 1620 * diff3.c (main): Use strerror (EISDIR) instead of "Is a directory". 1621 (fatal, perror_with_exit): Use `error'. 1622 * util.c (perror_with_name, fatal): Use GNU `error'. 1623 (error): Remove. 1624 1625Wed Oct 12 17:04:40 1994 David J. MacKenzie (djm@duality.gnu.ai.mit.edu) 1626 1627 * cmp.c (main): Set xmalloc_exit_failure. 1628 1629Sat Oct 1 05:24:19 1994 Paul Eggert <eggert@twinsun.com> 1630 1631 * Version 2.7 released. 1632 1633 * configure.in (AC_HEADER_SYS_WAIT): Add. 1634 (AC_CHECK_HEADERS): Remove sys/wait.h. 1635 (AC_CHECK_FUNCS): Add tmpnam. 1636 * system.h (<sys/wait.h>, WEXITSTATUS): Use simpler scheme 1637 now that HAVE_SYS_WAIT_H is not set on hosts 1638 that are incompatible with Posix applications. 1639 1640 * util.c (dir_file_pathname): Use filename_lastdirchar not strrchr. 1641 * sdiff.c (expand_name): Likewise. 1642 (private_tempnam): Use tmpnam if HAVE_TMPNAM; this simplifies porting. 1643 (exists, letters): Omit if HAVE_TMPNAM. 1644 1645 * diff3.c (read_diff): If STAT_BLOCKSIZE yields zero, 1646 adjust it to a more reasonable value. 1647 1648Sat Sep 24 20:36:40 1994 Paul Eggert <eggert@twinsun.com> 1649 1650 * sdiff.c (exists, private_tempname): Adopt latest GNU libc algorithm. 1651 (private_tempnam): Specialize for sdiff to avoid portability problems. 1652 1653Thu Sep 22 16:47:00 1994 Paul Eggert <eggert@twinsun.com> 1654 1655 * configure.in (AC_ARG_PROGRAM): Added. 1656 (AC_OUTPUT): Add [date > stamp-h]. 1657 1658 * Makefile.in (DEFAULT_EDITOR_PROGRAM, DIFF_PROGRAM, LIBOBJS, 1659 NULL_DEVICE, PR_PROGRAM, PROGRAMS): New variables. 1660 (check, stamp-h.in, cmp.o, util.o): New targets. 1661 (edit_program_name): New variable; replaces old binprefix method. 1662 (install, uninstall): Use it. 1663 (binprefix): Removed. 1664 (distfiles): Add stamp-h.in. 1665 (clean): Clean stamp-h. 1666 (config.hin, config.h): Use time stamp files. 1667 (cmp_o): Add $(LIBOBJS). 1668 (install): Install info files from srcdir if they're not in `.'. 1669 1670 * cmp.c, io.c (word): Don't define if already defined. 1671 1672 * comp.c (main): Use setmode, not open(..., O_BINARY); this gets stdin. 1673 Use NULL_DEVICE instead of "/dev/null". 1674 (cmp): Use %lu instead of %ld when it is more likely to be right. 1675 1676 * diff.h (PR_FILE_NAME): Rename to PR_PROGRAM and move to Makefile.in, 1677 util.c. 1678 1679 * diff3.c (main): Give proper diagnostic if too many labels were given. 1680 (read_diff): Use SYSTEM_QUOTE_ARG. 1681 1682 * system.h: <string.h>: Include if HAVE_STRING_H, too. 1683 <ctype.h>: Include here. All includers changed. 1684 (CTYPE_DOMAIN, ISDIGIT, ISPRINT, ISSPACE, ISUPPER): New macros that 1685 work around common <ctype.h> problems. 1686 (O_BINARY): Remove. 1687 (SYSTEM_QUOTE_ARG): New macros. 1688 1689 * diff.c: Add comment. 1690 1691 * util.c (PR_PROGRAM): Moved here from diff.h. 1692 (begin_output): Use SYSTEM_QUOTE_ARG. 1693 1694 * io.c (read_files): Set mode to binary before returning 1. 1695 1696 * sdiff.c (TMPDIR_ENV): New macro. 1697 (DEFAULT_EDITOR_PROGRAM): Renamed from DEFAULT_EDITOR for consistency. 1698 (expand_name): Change `isdir' to `is_dir' to avoid theoretical ctype 1699 namespace contamination. 1700 (main): Use SYSTEM_QUOTE_ARG. 1701 (private_tempnam): Don't access "/tmp" directly; use PVT_tmpdir. 1702 1703Tue Sep 13 18:46:43 1994 Paul Eggert <eggert@twinsun.com> 1704 1705 * configure.in (AC_FUNC_MEMCHR): Remove. Autoconf didn't adopt this, 1706 since we need not worry about an old experimental library 1707 where memchr didn't work. 1708 (AC_FUNC_MEMCMP): Not needed, since we only test for equality. 1709 (AC_REPLACE_FUNCS): Add test for memchr. 1710 (AC_CHECK_FUNCS): Check for memchr, not memcpy, since it'll be cached. 1711 (AC_CHECK_HEADERS): Add string.h; regex.c uses on some old hosts. 1712 1713 * system.h (memcmp): Define in terms of bcmp. 1714 Use HAVE_MEMCHR to test for all mem* routines. 1715 1716 * Makefile.in (srcs): Remove memcmp.c. 1717 We use bcmp if memcmp doesn't work, since we only test for equality. 1718 1719Mon Sep 12 15:52:22 1994 Paul Eggert <eggert@twinsun.com> 1720 1721 * configure.in (AC_CONFIG_HEADER): Rename config.h.in to config.hin. 1722 (AC_ISC_POSIX, AC_MINIX): Go back to these old names for Autoconf 2. 1723 (AC_CHECK_HEADERS): Remove now-redundant check for <string.h>. 1724 (AC_CHECK_FUNCS): Check for strchr. 1725 (AC_FUNC_MEMCHR, AC_FUNC_MEMCMP, AC_CHECK_FUNCS): Use special-purpose 1726 macros when suitable. 1727 * memcmp.c: New file. 1728 * Makefile.in (CPPFLAGS, DEFS, CFLAGS, LDFLAGS, prefix, exec_prefix): 1729 Default to autoconf-specified strings. 1730 (COMPILE): Use the defaults. 1731 (srcs): Add memcmp.c. 1732 (distfiles): Rename config.h.in->config.hin, install.sh->install-sh. 1733 (Makefile, config.h, config.hin, config.status): Rework for 1734 compatibility with Autoconf 2. 1735 * io.c (binary_file_p): Assume non-broken memchr. 1736 * memchr.c: Assume compiler understands void *; otherwise 1737 we don't match GCC's internal declaration of memchr. 1738 * system.h: Use more modern autoconf approach to standard C headers. 1739 * version.c: Include <config.h>, not "config.h". 1740 1741 * diff.c, diff.h (ignore_some_line_changes): 1742 New variable; replaces `length_varies'. 1743 (line_end_char): Replace with '\n'; it wasn't being used consistently. 1744 1745 * io.c (find_and_hash_each_line): Fix inconsistencies with -b -w -i and 1746 incomplete lines. Put incomplete lines into their own bucket. 1747 This means line_cmp no longer needs line length arguments, 1748 and equivalence classes' line lengths no longer need to include \n. 1749 Invoke line_cmp only if ignore_some_line_changes. 1750 (prepare_text_end): -B no longer ignores missing newlines. 1751 (read_files): Allocate another bucket for incomplete lines. 1752 1753 * util.c (line_cmp): Now takes just two arguments. No longer 1754 optimizes for common case of exact equality; the caller does that 1755 optimization now. The caller is changed accordingly. 1756 Optimize for the common case of mostly equality. 1757 Use isupper+tolower instead of islower+toupper, for consistency. 1758 1759 * waitpid.c (waitpid): Fix typo with internal scoping. 1760 1761Thu Sep 8 08:23:15 1994 Paul Eggert <eggert@twinsun.com> 1762 1763 * configure.in: Revamp for Autoconf 2. 1764 * memchr.c, waitpid.c: New source files for substitute functions. 1765 * Makefile.in (diff_o, diff3_o, sdiff_o): Add $(LIBOBJS). 1766 (srcs): Add memchr.c, waitpid.c. 1767 (distfiles): Add install.sh, memchr.c, waitpid.c, install.sh. 1768 * system.h: Use Autoconf 2 style HAVE_DIRENT_H etc. macros for dirs. 1769 * dir.c (dir_sort): Prefer NAMLEN (p) to strlen (p->d_name). 1770 Change VOID_CLOSEDIR to CLOSEDIR_VOID for Autoconf 2. 1771 * sdiff.c, util.c (memchr, waitpid): Remove; use new substitutes. 1772 * diff3.c (read_diff): Use new waitpid substitute. 1773 1774 * cmp.c, diff.c, diff3.c, sdiff.c (check_stdout, try_help): New fns. 1775 (usage): Just print more detailed usage message; let caller exit. 1776 * diff.c (option_help): New variable. 1777 (filetype): Add Posix.1b file types. 1778 1779Fri Sep 2 16:01:49 1994 Paul Eggert <eggert@twinsun.com> 1780 1781 * configure.in: Switch to new autoconf names. Add sys/file.h test. 1782 * Makefile.in (distclean): Clean config.cache, config.log 1783 (used by new autoconf). 1784 1785 * diff.c, diff3.c, (main), sdiff.c (trapsigs): If we'll have children, 1786 make sure SIGCHLD isn't ignored. 1787 1788 * diff3.c (DIFF_CHUNK_SIZE): Removed. Get size from STAT_BLOCKSIZE. 1789 (INT_STRLEN_BOUND): New macro. 1790 1791 * ifdef.c (format_group, groups_letter_value): 1792 Use * instead of [] in prototypes. 1793 1794 * system.h: Include <sys/file.h> only if HAVE_SYS_FILE_H. 1795 (S_IXGRP, S_IXOTH, S_IXUSR): Remove unused macros. 1796 1797 * util.c (begin_output): Check fdopen result. 1798 1799 The following changes simplify porting to non-Posix environments. 1800 * cmp.c, diff.c, diff3.c, sdiff.c, (main): Call initialize_main first. 1801 * diff.c (binary_I_O): New variable for --binary option. 1802 (main, usage, compare_files): Support --binary option. 1803 (compare_files): Use filename_lastdirchar to find last 1804 directory char in a file name. 1805 * cmp.c (main), diff.c (compare_files), dir.c (compare_names, 1806 diff_dirs): Use filename_cmp to compare file names. 1807 Use same_file to determine whether two files are the same. 1808 * context.c (print_context_label): Check whether ctime yields 0. 1809 * diff3.c (read_diff), sdiff.c (cleanup, main, waitpid), 1810 util.c (begin_output): Use popen+pclose if !HAVE_FORK. 1811 * io.c (sip): If HAVE_SETMODE, test for binary files in O_BINARY mode. 1812 * sdiff.c (ck_fdopen): Function removed. 1813 (edit): Use system if !HAVE_FORK. 1814 (execdiff): Now assumes caller has pushed all args, plus trailing 0. 1815 All callers changed. 1816 (private_tempnam): Try TMP if TMPDIR isn't defined. 1817 Fit temporary filenames into 8.3 limit. 1818 * system.h (STAT_BLOCKSIZE): Don't define if already defined. 1819 (min, max): Undef if already defined. 1820 (filename_cmp, filename_lastdirchar, HAVE_FORK, HAVE_SETMODE, 1821 initialize_main, O_BINARY, same_file): New macros. 1822 1823Fri Jun 17 11:23:53 1994 David J. MacKenzie (djm@geech.gnu.ai.mit.edu) 1824 1825 * Makefile.in (info, dvi, diff.dvi): New targets. 1826 (clean): Remove TeX output files. 1827 1828Fri Jun 17 05:37:52 1994 Paul Eggert (eggert@twinsun.com) 1829 1830 * cmp.c, io.c (word): Change from typedef to #define, to avoid 1831 collision with Unicos 8.0 <sys/types.h>, which also typedefs `word'. 1832 1833Thu Apr 15 00:53:01 1994 Paul Eggert (eggert@twinsun.com) 1834 1835 * diff3.c (scan_diff_line), util.c (print_number_range): Don't 1836 rely on promotion to make the old-style parameter type agree 1837 with the prototype parameter type; this doesn't work on 1838 Apollos running bsd4.3. 1839 1840Mon Jan 3 02:05:51 1994 Paul Eggert (eggert@twinsun.com) 1841 1842 * Makefile.in (LDFLAGS): Remove -g. Change all link commands 1843 to use both $(CFLAGS) and $(LDFLAGS). 1844 1845Mon Dec 13 12:23:27 1993 Paul Eggert (eggert@twinsun.com) 1846 1847 * system.h: Don't assume dirent.h exists just because 1848 _POSIX_VERSION is defined. 1849 1850Fri Dec 3 18:39:39 1993 Paul Eggert (eggert@twinsun.com) 1851 1852 * diff.c (main): allow -pu. 1853 1854Tue Nov 23 03:51:08 1993 Paul Eggert (eggert@twinsun.com) 1855 1856 * Makefile.in (distclean): Remove config.h. 1857 1858Wed Nov 10 00:28:27 1993 Paul Eggert (eggert@twinsun.com) 1859 1860 * Version 2.6 released. 1861 1862 * analyze.c (too_expensive): New variable, for heuristic to 1863 limit the worst-case cost to O(N**1.5 log N) at the price of 1864 producing suboptimal output for large inputs with many differences. 1865 (diff_2_files): Initialize it. 1866 (struct partition): New type. 1867 (SNAKE_LIMIT): New macro; merely documents already-used number 20. 1868 (diag): New `minimal' arg; all callers changed. Put results into 1869 struct partition. Apply `too_expensive' heuristic. Tune. 1870 (compareseq): New `minimal' arg; all callers changed. Tune. 1871 (shift_boundaries): Improve heuristic to also coalesce adjacent runs 1872 of changes more often. 1873 1874 * diff.c (long_options, main, usage): Add `--help'. 1875 (main): Send version number to stdout, not stderr. 1876 (usage): Send usage to stdout, not stderr. 1877 (compare_files): Initialize `inf' properly. 1878 1879 * io.c (word): Change to `int'; it makes a big difference on x86. 1880 (sip, slurp): Put off allocating room to hold the whole file until we 1881 have to read the whole file. This wins if the file turns out 1882 to be binary. 1883 1884 * util.c (xmalloc, xrealloc): "virtual memory" -> "memory" 1885 (primes): Omit large primes if INT_MAX is small. 1886 1887 * sdiff.c (usage): Send usage to stdout, not stderr. 1888 (long_options, main, usage): Add `--help'. 1889 (main): Send version number to stdout, not stderr. Exit afterwards. 1890 1891 * diff3.c (usage): Send usage to stdout, not stderr. 1892 (long_options, main, usage): Add `--help'. 1893 (read_diff): Detect integer overflow in buffer size calculations. 1894 1895 * cmp.c (word): New type. All uses of `long' for 1896 word-at-a-time comparisons changed to `word'. 1897 (long_options, main, usage): Add `--help'. 1898 (usage): Send usage to stdout, not stderr. 1899 (main): Add `-v'. Send version number to stdout, not stderr. 1900 1901 * configure.in (AC_HAVE_HEADERS): Add unistd.h; remove AC_UNISTD_H. 1902 1903Mon Sep 27 07:20:24 1993 Paul Eggert (eggert@twinsun.com) 1904 1905 * diff.c (add_exclude_file): Cast memchr to (char *) 1906 to suppress bogus warnings on some nonstandard hosts. 1907 1908 * Makefile.in (cmp): Add version.o. 1909 1910 * analyze.c (diff_2_files): Work around memcmp bug with size=0. 1911 1912 * cmp.c (main, usage, version_string): Add --version option. 1913 1914 * system.h (malloc, realloc): Declare only if !HAVE_STDLIB_H. 1915 (memchr): Declare only if !HAVE_MEMCHR. These changes are 1916 needed to keep some nonstandard hosts happy. 1917 1918 * util.c (memchr): Make first arg char const * 1919 to match standard. 1920 (xmalloc, xrealloc): Cast malloc, realloc 1921 to (VOID *) to suppress bogus warnings on some nonstandard hosts. 1922 1923 * diff3.c (xmalloc, xrealloc): Cast malloc, realloc 1924 to (VOID *) to suppress bogus warnings on some nonstandard hosts. 1925 1926 * sdiff.c (xmalloc, xrealloc): Cast malloc, realloc 1927 to (VOID *) to suppress bogus warnings on some nonstandard hosts. 1928 (lf_copy, lf_skip, lf_snarf): Cast memchr to (char *) 1929 to suppress bogus warnings on some nonstandard hosts. 1930 (memchr): Make first arg char const * 1931 to match standard. 1932 1933Mon Sep 27 00:23:37 1993 Paul Eggert (eggert@twinsun.com) 1934 1935 * Version 2.5 released. 1936 1937 * analyze.c (diff_2_files): Work around memcmp bug with size=0. 1938 1939 * cmp.c (main, usage, version_string): Add --version option. 1940 * Makefile.in (cmp): Add version.o. 1941 1942 * diff.c (add_exclude_file): Cast memchr to (char *) 1943 to suppress bogus warnings on some nonstandard hosts. 1944 * sdiff.c (lf_copy, lf_skip, lf_snarf): Likewise. 1945 1946 * diff3.c, sdiff.c, util.c (xmalloc, xrealloc): Cast malloc, realloc 1947 to (VOID *) to suppress bogus warnings on some nonstandard hosts. 1948 1949 * sdiff.c, util.c (memchr): Make first arg char const * 1950 to match standard. 1951 1952 * system.h (malloc, realloc): Declare only if !HAVE_STDLIB_H. 1953 (memchr): Declare only if !HAVE_MEMCHR. These changes are 1954 needed to keep some nonstandard hosts happy. 1955 1956 * xmalloc.c: Include <sys/types.h> always; some nonstandard hosts 1957 need it for size_t even if STDC_HEADERS. 1958 1959Sat Sep 18 01:33:07 1993 Paul Eggert (eggert@twinsun.com) 1960 1961 * configure.in (AC_STAT_MACROS_BROKEN): Add. 1962 * system.h (S_IS{BLK,CHR,DIR,FIFO,REG,SOCK}): Fix defns if 1963 STAT_MACROS_BROKEN. 1964 1965 * Makefile.in (diff3, sdiff, cmp): Do not link $(ALLOCA). 1966 1967 * analyze.c (discard_confusing_lines): Make defn static, like decl. 1968 * sdiff.c (xmalloc): Likewise. 1969 1970 * ifdef.c (format_group): Ensure isdigit argument isn't < 0. 1971 1972 * side.c (print_half_line): Use isprint, since some hosts lack isgraph. 1973 * util.c (output_1_line): Likewise. Ensure its argument isn't < 0. 1974 (xmalloc, xrealloc): Remove needless casts. 1975 1976 * system.h (volatile, const): 1977 Define these before including any system headers, 1978 so that they're used consistently in all system includes. 1979 (getenv, malloc, realloc): Declare even if HAVE_STDLIB_H, since some 1980 <stdlib.h>s don't declare them. 1981 (memchr): Likewise for <string.h>. 1982 1983 * cmp.c, diff3.c, diff.h, sdiff.c: Include "system.h" first. 1984 * diff.c: Remove redundant "system.h" inclusion. 1985 1986 * diff3.c (xmalloc): Now static. 1987 (xmalloc, realloc): Remove needless casts. 1988 (READNUM): Ensure isdigit argument isn't negative. 1989 1990Wed Sep 14 07:14:15 1993 Paul Eggert (eggert@twinsun.com) 1991 1992 * Version 2.4 released. 1993 1994 * ifdef.c (scan_char_literal): New function, for new %c'x' and 1995 %c'\ooo' format specs. 1996 (format_group, print_ifdef_lines): Use it. Remove %0 format spec. 1997 1998 * cmp.c (cmp): Don't try to read past end of file; this doesn't 1999 work on ttys. 2000 2001 * system.h, version.c: #include <config.h>, not "config.h", to allow 2002 configuring in a separate directory when the source directory has 2003 already been configured. 2004 * Makefile.in (COMPILE): New defn, with proper -I options so that 2005 `#include <config.h>' works. 2006 (.c.o, diff3.o, sdiff.o): Use it. 2007 2008Mon Sep 13 06:45:43 1993 Paul Eggert (eggert@twinsun.com) 2009 2010 * diff.c (main, longopts): Add --line-format=FORMAT option. 2011 (specify_format): Args no longer const pointers. All callers changed. 2012 2013 * ifdef.c: Add support for %?c, %(A=B?T:E), PRINTF_SPECn formats. 2014 (struct group): New struct. 2015 (print_ifdef_lines): Use it to simplify argument passing. 2016 Remove the convention that last arg -1 signifies that the lines 2017 from file 2 are the same as the lines from file 1; this 2018 convention no longer works, now that line numbers might be 2019 printed out, since the line numbers may differ. 2020 Add first FILE * argument to output to. All callers changed. 2021 Use a faster test for the single-fwrite optimization. 2022 (format_group, scan_printf_spec, groups_letter_value): New functions. 2023 2024 * diff.h (group_format, line_format): No longer const pointers. 2025 (format_ifdef): 1st arg is no longer const pointer. 2026 2027 * configure.in: Configure HAVE_LIMITS_H, HAVE_STDLIB_H. 2028 * system.h <limits.h>, <stdlib.h>, <string.h>: 2029 Include only if HAVE_LIMITS_H etc. 2030 2031 * system.h (memcmp, memcpy, strchr, strrchr, struct dirent): Prefer 2032 these standard names to the traditional names (bcmp, bcpy, index, 2033 rindex, struct direct). All callers changed. 2034 2035 * system.h (PARAMS, VOID): 2036 Define earlier so that malloc decl can use VOID. 2037 (STAT_BLOCKSIZE): Simplify ersatz defn; just use 8K. 2038 2039Fri Sep 3 00:21:02 1993 Paul Eggert (eggert@twinsun.com) 2040 2041 * diff.c (compare_files): Two files with the same name must be 2042 the same file; avoid a needless `stat' in that case. 2043 2044Fri Aug 27 06:59:03 1993 Paul Eggert (eggert@twinsun.com) 2045 2046 * Pervasive changes for portability to 64-bit hosts: 2047 Add prototypes to function declarations. 2048 Use size_t, not int, when needed. 2049 2050 * Other pervasive changes: 2051 Use `const' more often. 2052 Use STD{IN,OUT,ERR}_FILENO instead of [012]. 2053 Use 0, not NULL, for portability to broken hosts. 2054 2055 * Makefile.in: (srcs, objs, distfiles, cmp): New files cmpbuf.[ch]. 2056 (distfiles): New files config.h.in, mkinstalldirs. 2057 (.c.o): Add -DHAVE_CONFIG_H. 2058 2059 * analyze.c: (diag): Pacify `gcc -Wall' with a useless assignment. 2060 (diff_2_files): Use l.c.m., not max, of files' buffer sizes. 2061 2062 * cmp.c: Make globals static when possible. 2063 2064 (file): Now a 2-element array; replaces `file1' and `file2'. 2065 (file_desc, buffer): Likewise, for file[12]_desc and buf[12]. 2066 (main): Likewise, for stat_buf[12]. Index these variables with `i'. 2067 2068 (ignore_initial): New var. 2069 (long_options): Now const. Add `--ignore-initial'. 2070 (usage): Sort options and add `--ignore-initial'. 2071 (main, cmp): Add `--ignore-initial' support. 2072 2073 (main): `cmp - -' now succeeds. 2074 When comparing standard input to a file, and using a shortcut (e.g. 2075 looking at file sizes or inode numbers), take the lseek offset into 2076 account before deciding whether the files are identical. 2077 Avoid mentioning `dev_t', `ino_t' for portability to nonstandard hosts. 2078 Use l.c.m. of files' buffer sizes, not 8 * 1024. 2079 ferror (stdout) does not imply errno has a useful value. 2080 If 2nd file is "-", treat it first, in case stdin is closed. 2081 2082 (cmp): Always compute `char_number', `smaller' for speed and simplicity. 2083 Say `cmp: EOF on input', not `/usr/gnu/bin/cmp: EOF on input', 2084 as per Posix.2. 2085 2086 (block_compare_and_count): Increment line_number argument. 2087 Remove end_char argument; it's always '\n'. All callers changed. 2088 Do not assume sizeof(long) == 4; this isn't true on some 64-bit hosts. 2089 (block_compare): Minimize differences with block_compare_and_count. 2090 2091 (block_read): Coalesce `bp += nread's. 2092 2093 (printc): Remove `FILE *' arg; output to stdout. All callers changed. 2094 2095 * configure.in: Configure HAVE_SIGACTION, RETSIGTYPE, HAVE_VPRINTF. 2096 Configure into config.h. 2097 2098 * context.c (print_context_label): 2099 Standard input's st_mtime is no longer a special case 2100 here, since `compare_files' now sets it to the current time. 2101 2102 * diff.c (usage): Sort options. 2103 (filetype): New function. 2104 (compare_files): Set stdin's st_mtime to be the current time. 2105 Leave its name "-" instead of changing it to "Standard Input"; 2106 to test whether a file is stdin, we must compare its name to "-" instead 2107 of its desc to 0, since if it's closed other file descs may be 0. 2108 When comparing standard input to a file, and using a shortcut (e.g. 2109 looking at file sizes or inode numbers), take the lseek offset into 2110 account before deciding whether the files are identical. 2111 Pretend that nonexistent files have the same filetype as existing files. 2112 Rename `errorcount' to `failed', since it's boolean. 2113 In directory comparisons, if a file is neither a regular file nor a 2114 directory, just print its type and the other file's type. 2115 2116 * diff.h (Is_space, textchar): Remove. 2117 (struct msg, msg_chain, msg_chain_end): Move to util.c. 2118 (VOID): Move to system.h. 2119 (line_cmp, version_string, change_letter, print_number_range, 2120 find_change): New decls. 2121 2122 * diff.texi: 2123 whitespace -> white space. It now stands for whatever isspace yields. 2124 Add --ignore-initial. 2125 2126 * diff3.c (VOID): Move to system.h. 2127 (version_string): Now char[]. 2128 (usage): Sort options. 2129 (process_diff): Pacify `gcc -Wall' with a useless assignment. 2130 (read_diff): pid is of type pid_t, not int. Use waitpid if available. 2131 (output_diff3): Simplify test for `\ No newline at end of file' message. 2132 2133 * dir.c (struct dirdata): Rename `files' to `names' to avoid confusion 2134 with external struct file_data `files'. 2135 2136 * io.c (line_cmp): Move declaration to diff.h. 2137 (textchar): Remove. 2138 (find_and_hash_each_line): Use locale's definition of white space 2139 instead of using one hardwired defn for -b and another for -w. 2140 2141 * normal.c (change_letter, print_number_range, find_change): 2142 Move decls to diff.h. 2143 (print_normal_hunk): Now static. 2144 2145 * sdiff.c (SEEK_SET): Move to system.h. 2146 (version_string): Now char[], not char*. 2147 (private_tempnam): Remove hardcoded limit on temporary file names. 2148 (exiterr, perror_fatal, main): When exiting because of a signal, 2149 exit with that signal's status. 2150 (lf_refill, main, skip_white, edit, interact): Check for signal. 2151 (ignore_SIGINT): Renamed from `ignore_signals'. 2152 (NUM_SIGS, initial_handler): New macros. 2153 (initial_action, signal_received, sigs_trapped): New vars. 2154 (catchsig, trapsigs): Use sigaction if possible, since this closes the 2155 windows of vulnerability that `signal' has. Use RETSIGTYPE not void. 2156 When a signal comes in, just set a global variable; this is safer. 2157 (checksigs, untrapsig): New functions. 2158 (edit): Pacify `gcc -Wall' with a useless assignment. 2159 Respond to each empty line with help, not to every other empty line. 2160 (private_tempnam): Remove hardcoded limit on temporary file name length. 2161 Don't assume sizeof (pid_t) <= sizeof (int). 2162 2163 * system.h: (S_IXOTH, S_IXGRP, S_IXUSR, 2164 SEEK_SET, SEEK_CUR, 2165 STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO): 2166 New macros, if system doesn't define them. 2167 (volatile): Don't define if already defined. 2168 (PARAMS): New macro. 2169 (VOID): Move here from diff.h. 2170 2171 * util.c (struct msg, msg_chain, msg_chain_end): Moved here from diff.h. 2172 (message5): New function. 2173 (pr_pid): New var. 2174 (begin_output): Allocate `name' more precisely. 2175 Put child pid into pr_pid, so that we can wait for it later. 2176 Don't check execl's return value, since any return must be an error. 2177 (finish_output): Detect and report output errors. 2178 Use waitpid if available. Check pr exit status. 2179 (line_cmp): Use locale's definition of white space 2180 instead of using one hardwired defn for -b and another for -w. 2181 (analyze_cmp): Avoid double negation with `! nontrivial'. 2182 Pacify `gcc -Wall' be rewriting for-loop into do-while-loop. 2183 (dir_file_pathname): New function. 2184 2185 * version.c (version_string): Now char[], not char*. 2186 2187Thu Jul 29 20:44:30 1993 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu) 2188 2189 * Makefile.in (config.status): Run config.status --recheck, not 2190 configure, to get the right args passed. 2191 2192Thu Jul 22 10:46:30 1993 Paul Eggert (eggert@twinsun.com) 2193 2194 * Makefile.in (dist): Replace `if [ ! TEST ]; then ACTION; fi' 2195 with `[ TEST ] || ACTION || exit' so that the containing for-loop exits 2196 with proper status for `make'. 2197 2198Thu Jul 8 19:47:22 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) 2199 2200 * Makefile.in (installdirs): New target. 2201 (install): Use it. 2202 (Makefile, config.status, configure): New targets. 2203 2204Sat Jun 5 23:10:40 1993 Paul Eggert (eggert@twinsun.com) 2205 2206 * Makefile.in (dist): Switch from .z to .gz. 2207 2208Wed May 26 17:16:02 1993 Paul Eggert (eggert@twinsun.com) 2209 2210 * diff.c (main): Cast args to compare_files, for traditional C. 2211 * side.c (print_sdiff_common_lines_print_sdiff_hunk): Likewise. 2212 * analyze.c, diff3.c, sdiff.c, util.c: Don't assume NULL is defined 2213 properly. 2214 2215Tue May 25 14:54:05 1993 Paul Eggert (eggert@twinsun.com) 2216 2217 * analyze.c (diff_2_files): With -q, do not report that files differ 2218 if all their differences are ignored. 2219 (briefly_report): New function. 2220 * diff.h (ignore_some_changes): New variable. 2221 * diff.c (compare_files): Don't use the file size shortcut if 2222 ignore_some_changes is nonzero, since the file size may differ 2223 merely due to ignored changes. 2224 (main): Set ignore_some_changes if we might ignore some changes. 2225 Remove unsystematic assignment of 0 to static vars. 2226 * io.c (read_files): New argument PRETEND_BINARY says whether to 2227 pretend the files are binary. 2228 2229 * diff3.c (tab_align_flag): New variable, for new -T option. 2230 (main, usage, output_diff3): Add support for -T. 2231 2232Sun May 23 15:25:29 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) 2233 2234 * dir.c (dir_sort): Always init `data' to avoid GCC warning. 2235 2236Sat May 22 15:35:02 1993 Paul Eggert (eggert@twinsun.com) 2237 2238 * Makefile.in (dist): Change name of package from diff to diffutils. 2239 Don't bother to build .Z dist; .z suffices. 2240 2241Fri May 21 16:35:22 1993 Paul Eggert (eggert@twinsun.com) 2242 2243 * diff.c: Include "system.h" to get memchr declaration. 2244 * system.h (memchr): Declare if !HAVE_MEMCHR, not if 2245 !HAVE_MEMCHR && !STDC_HEADERS. 2246 2247Wed May 19 17:43:55 1993 Paul Eggert (eggert@twinsun.com) 2248 2249 * Version 2.3 released. 2250 2251Fri Apr 23 17:18:44 1993 Paul Eggert (eggert@twinsun.com) 2252 2253 * io.c (find_identical_ends): Do not discard the last HORIZON_LINES 2254 lines of the prefix, or the first HORIZON_LINES lines of the suffix. 2255 * diff.c (main, longopts, usage): Add --horizon-lines option. 2256 * diff3.c (main, process_diff, read_diff): Invoke second diff 2257 with --horizon-lines determined by the first diff. 2258 * diff.h, diff3.c (horizon_lines): New variable. 2259 2260Mon Mar 22 16:16:00 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) 2261 2262 * system.h [HAVE_STRING_H || STDC_HEADERS] (bcopy, bcmp, bzero): 2263 Don't define if already defined. 2264 2265Fri Mar 5 00:20:16 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) 2266 2267 * diff.c (main): Use NULL in arg to compare_files. 2268 2269Thu Feb 25 15:26:01 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) 2270 2271 * system.h: Declare memchr #if !HAVE_MEMCHR && !STDC_HEADERS, 2272 not #if !HAVE_MEMCHR || !STDC_HEADERS. 2273 2274Mon Feb 22 15:04:46 1993 Richard Stallman (rms@geech.gnu.ai.mit.edu) 2275 2276 * io.c (find_identical_ends): Move complicated arg outside GUESS_LINES. 2277 2278Mon Feb 22 12:56:12 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) 2279 2280 * Makefile.in (.c.o): Add -I$(srcdir); put $(CFLAGS) last before $<. 2281 2282Sat Feb 20 19:18:56 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) 2283 2284 * io.c (binary_file_p): Return zero if file size is zero. 2285 2286Fri Feb 19 17:31:32 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu) 2287 2288 * Version 2.2 released. 2289 2290 * system.h [HAVE_STRING_H || STDC_HEADERS] (index, rindex): Don't 2291 define if already defined. 2292 2293Wed Feb 17 17:08:00 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) 2294 2295 * Makefile.in (srcs): Remove limits.h. 2296 2297Thu Feb 11 03:36:00 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) 2298 2299 * diff3.c (xmalloc): No longer static. 2300 2301 * sdiff.c (edit): Allocate buf dynamically. 2302 2303 * dir.c (dir_sort): Handle VOID_CLOSEDIR. 2304 2305Wed Feb 10 00:15:54 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) 2306 2307 * limits.h: File deleted (should never have been there). 2308 2309Tue Feb 9 03:53:22 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) 2310 2311 * Makefile.in (.c.o, diff3.o, sdiff.o): Put $(CFLAGS) last. 2312 2313Wed Feb 3 15:42:10 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) 2314 2315 * system.h: Don't #define const; let configure do it. 2316 2317Mon Feb 1 02:13:23 1993 Paul Eggert (eggert@hal.gnu.ai.mit.edu) 2318 2319 * Version 2.1 released. 2320 2321 * Makefile.in (dist): Survive ln failures. Create .tar.z 2322 (gzipped tar) file as well as .tar.Z (compressed tar) file. 2323 2324Fri Jan 8 22:31:41 1993 Paul Eggert (eggert@twinsun.com) 2325 2326 * side.c (print_half_line): When the input position falls 2327 outside the column, do not output a tab even if the output 2328 position still falls within the column. 2329 2330Mon Dec 21 13:54:36 1992 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu) 2331 2332 * Makefile.in (.c.o): Add -I. 2333 2334Fri Dec 18 14:08:20 1992 Paul Eggert (eggert@twinsun.com) 2335 2336 * configure.in: Add HAVE_FCNTL_H, since system.h uses it. 2337 2338Tue Nov 24 10:06:48 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) 2339 2340 * Makefile.in: Note change from USG to HAVE_STRING_H. 2341 2342Mon Nov 23 18:44:00 1992 Paul Eggert (eggert@twinsun.com) 2343 2344 * io.c (find_and_hash_each_line): When running out of lines, 2345 double the number of allocated lines, instead of just doubling 2346 that number minus the prefix lines. This is more likely to 2347 avoid the need for further memory allocation. 2348 2349Wed Nov 18 20:40:28 1992 Paul Eggert (eggert@twinsun.com) 2350 2351 * dir.c (dir_sort): Plug memory leak: space holding directory 2352 contents was not being reclaimed. Get directory size from 2353 struct file_data for initial guess at memory needed. 2354 Detect errors when reading and closing directory. 2355 (diff_dirs): Pass struct file_data to dir_sort. Finish plugging leak. 2356 * diff.c (compare_files): Pass struct file_data to diff_dirs. 2357 2358 * io.c (find_and_hash_each_line): Don't assume alloc_lines is 2359 nonzero when allocating more lines. 2360 2361Thu Nov 12 16:02:18 1992 Paul Eggert (eggert@twinsun.com) 2362 2363 * diff.c (main): Add `-U lines' as an alias for `--unified=lines'. 2364 2365 * diff3.c (usage): Add third --label option in example. 2366 2367 * util.c (analyze_hunk): Fix test for ignoring blank lines. 2368 2369 * configure.in, system.h: Avoid USG; use HAVE_TIME_H etc. instead. 2370 2371Mon Nov 9 05:13:25 1992 Paul Eggert (eggert@twinsun.com) 2372 2373 * diff3.c (main, usage): Add -A or --show-all. 2374 -m now defaults to -A, not -E. Allow up to three -L options. 2375 (output_diff3_edscript, output_diff3_merge): 2376 Remove spurious differences between these two functions. 2377 Output ||||||| for -A. Distinguish between conflicts and overlaps. 2378 (dotlines, undotlines): New functions that output `Ns', not `N,Ns'. 2379 (output_diff3_edscript, output_diff3_merge): Use them. 2380 2381 * io.c (find_identical_ends): shift_boundaries needs an extra 2382 identical line at the end, not at the beginning. 2383 2384 * sdiff.c (edit): execvp wants char **, not const char **. 2385 2386Mon Oct 19 04:39:32 1992 Paul Eggert (eggert@twinsun.com) 2387 2388 * context.c (print_context_script, find_function): Context 2389 line numbers start with - file->prefix_lines, not 0. 2390 2391 * io.c (binary_file_p): Undo last change; it was a library bug. 2392 2393Sun Oct 18 00:17:29 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) 2394 2395 * io.c (binary_file_p): Consider empty file as non-binary. 2396 2397Mon Oct 5 05:18:46 1992 Paul Eggert (eggert@twinsun.com) 2398 2399 * diff3.c (main, make_3way_diff, using_to_diff3_block): Don't 2400 report bogus differences (for one of -mexEX3) just because the 2401 file0-file1 diffs don't line up with the file0-file2 diffs. 2402 (This is entirely possible since we don't use diff's -n 2403 option.) Always compare file1 to file2, so that diff3 sees 2404 those changes directly. Typically, file2 is now the common 2405 file, not file0. 2406 (output_diff3_merge): The input file is file 0, not the common file. 2407 2408 (FC, FO): New macros; they replace FILE1, FILE0 for two-way diffs, 2409 to distinguish them from three-way diffs. 2410 2411 * diff3.c (using_to_diff3_block): Fold repeated code into loops. 2412 2413 * diff3.c (make_3way_diff, process_diff): Have the *_end 2414 variable point to the next field to be changed, not to the last 2415 object allocated; this saves an if-then-else. 2416 2417 * diff3.c (process_diff): Use D_NUMLINES instead of its definiens. 2418 2419 * diff3.c: Make fns and vars static unless they must be external. 2420 2421Wed Sep 30 09:21:59 1992 Paul Eggert (eggert@twinsun.com) 2422 2423 * analyze.c (diff_2_files): OUTPUT_IFDEF is now robust. 2424 * diff.h (ROBUST_OUTPUT_STYLE): Likewise. 2425 (default_line_format): Remove. All refs removed. 2426 2427 * ifdef.c (print_ifdef_lines): Add %L. Optimize %l\n even if user 2428 specified it, as opposed to its being the default. 2429 2430Tue Sep 29 19:01:28 1992 Paul Eggert (eggert@twinsun.com) 2431 2432 * diff.c (longopts, main): --{old,new,unchanged,changed}--group-format 2433 are new options, so that -D is no longer overloaded. Set 2434 no_diff_means_no_output if --unchanged-{line,group}-format allows it. 2435 * diff.h (enum line_class): New type. 2436 (group_format, line_format): Use it to regularize option flags. 2437 All refs changed. 2438 2439 * ifdef.c (format_ifdef, print_ifdef_lines): %n is no longer a format. 2440 2441Mon Sep 28 04:51:42 1992 Paul Eggert (eggert@twinsun.com) 2442 2443 * diff.c (main, usage): Replace --line-prefix with the more general 2444 --{old,new,unchanged}-line-format options. 2445 * ifdef.c (format_ifdef, print_ifdef_lines): Likewise. 2446 * diff.h (line_format): Renamed from line_prefix. All refs changed. 2447 * diff.h, ifdef.c (default_line_format): New variable. 2448 * util.c (output_1_line): New function. 2449 (print_1_line): Use it. 2450 2451 * ifdef.c: (format_ifdef, print_ifdef_lines): Add %0 format. 2452 2453Sun Sep 27 05:38:13 1992 Paul Eggert (eggert@twinsun.com) 2454 2455 * diff.c (main): Add -E or --line-prefix option. Add -D'=xxx' 2456 for common lines. Change default -D< format from copy of -D> 2457 format to to -D<%<; similarly for default -D> format. 2458 * diff.h (common_format, line_prefix): New variables. 2459 * ifdef.c (format_ifdef): New function. 2460 (print_ifdef_script, print_ifdef_hunk, print_ifdef_lines): 2461 Use it for -D'=xxx', -E. 2462 2463 * context.c (find_hunk): Glue together two non-ignorable changes that 2464 are exactly CONTEXT * 2 lines apart. This shortens output, removes 2465 a behavioral discontinuity at CONTEXT = 0, and is more compatible 2466 with traditional diff. 2467 2468 * io.c (find_identical_ends): Slurp stdin at most once. 2469 2470 * util.c (print_line_line): line_flag is const char *. 2471 2472Thu Sep 24 15:18:07 1992 Paul Eggert (eggert@twinsun.com) 2473 2474 * ifdef.c (print_ifdef_lines): New function, which fwrites a sequence 2475 of lines all at once for speed. 2476 (print_ifdef_script, print_ifdef_hunk): Use it. 2477 2478Thu Sep 24 05:54:14 1992 Paul Eggert (eggert@twinsun.com) 2479 2480 * diff.c (main): Support new -D options for if-then-else formats. 2481 (specify_format): New function. 2482 * diff.h (ifndef_format, ifdef_format, ifnelse_format): New variables. 2483 * ifdef.c (print_ifdef_hunk): Use the new variables instead of 2484 a hardwired format. 2485 2486 * side.c (print_1sdiff_line): Represent incomplete lines on output. 2487 (print_sdiff_script): Likewise. Don't print 'q' at end, 2488 since that doesn't work with incomplete lines. 2489 * sdiff.c (interact): Don't assume diff output ends with 'q' line. 2490 * diff.h (ROBUST_OUTPUT_STYLE): OUTPUT_SDIFF is now robust. 2491 2492 * sdiff.c (lf_copy, lf_snarf): Use memchr instead of index, 2493 to avoid dumping core when files contain null characters. 2494 (memchr): New function (if memchr is missing). 2495 2496 * io.c (sip): New arg SKIP_TEST to skip test for binary file. 2497 (read_files): Don't bother testing second file if first is binary. 2498 2499Thu Sep 17 21:17:49 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) 2500 2501 * system.h [!USG && !_POSIX_VERSION]: Protect from conflicting 2502 prototype for wait in sys/wait.h. 2503 2504Wed Sep 16 12:32:18 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) 2505 2506 * Makefile.in: Include binprefix in -DDIFF_PROGRAM. 2507 2508Tue Sep 15 14:27:25 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) 2509 2510 * Version 2.0. 2511 2512Sat Sep 12 01:31:19 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) 2513 2514 * util.c, diff.h, system.h [!HAVE_MEMCHR]: Don't use void * 2515 and const when declaring memchr replacement. Declare memchr 2516 if !STDC_HEADERS && !USG. 2517 2518Thu Sep 10 15:17:32 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) 2519 2520 * Makefile.in (uninstall): New target. 2521 2522 * diff.c (excluded_filename): Use fnmatch, not wildmat. 2523 (usage): Document -x, -X, --exclude, --exclude-from. 2524 Makefile.in: Use fnmatch.c, not wildmat.c. 2525 2526Sun Sep 6 23:46:25 1992 Paul Eggert (eggert@twinsun.com) 2527 2528 * configure.in: Add HAVE_MEMCHR. 2529 * diff.h, util.c: Use it instead of MEMCHR_MISSING. 2530 2531Sun Sep 6 07:25:49 1992 Paul Eggert (eggert@twinsun.com) 2532 2533 * diff.h: (struct line_def): Replace this 3-word struct with char *. 2534 This uses less memory, particularly for large files with short lines. 2535 (struct file_data): New member linbuf_base counts number of lines 2536 in common prefix that are not recorded in linbuf; 2537 this uses less memory if files are identical or differ only at end. 2538 New member buffered_lines counts possibly differing lines. 2539 New member valid_lines counts valid data. 2540 New member alloc_lines - linbuf_base replaces old linbufsize. 2541 linbuf[0] now always points at first differing line. 2542 Remove unused members ltran, suffix_lines. 2543 Add const where appropriate. 2544 (Is_space): New macro, for consistent definition of `white space'. 2545 (excluded_filename, memchr, sip, slurp): New declarations. 2546 * ed.c (print_ed_hunk): Adjust to diff.h's struct changes. 2547 * context.c (pr_context_hunk): Likewise. 2548 * ifdef.c (print_ifdef_script): Likewise. 2549 * side.c (print_sdiff_script, print_half_line): Likewise. 2550 * util.c (analyze_hunk, line_cmp, print_1_line): Likewise. 2551 2552 * analyze.c (shift_boundaries): Remove unneeded variable `end' and 2553 unnecessary comparisons of `preceding' and `other_preceding' against 0. 2554 (diff_2_files): When comparing files byte-by-byte for equality, 2555 don't slurp them all in at once; just compare them a buffer at a time. 2556 This can win big if they differ early on. 2557 Move some code to compare_files to enable this change. 2558 Use only one buffer for stdin with `diff - -'. 2559 (discard_confusing_lines, diff_2_files): Coalesce malloc/free calls. 2560 (build_script): Remove obsolete OUTPUT_RCS code. 2561 2562 * diff.c (add_exclude, add_exclude_file, excluded_filename): New fns. 2563 (main): Use them for the new --exclude and --exclude-from options. 2564 (compare_files): Don't open a file unless it must be read. 2565 Treat `diff file file' and `diff file dir' similarly. 2566 Move some code here from diff_2_files to enable this. 2567 Simplify file vs dir warning. 2568 2569 * dir.c (dir_sort): Support new --exclude* options. 2570 2571 * io.c (struct equivclass): Put hash code and line length here instead 2572 of struct line_def, so that they can be shared. 2573 (find_and_hash_each_line): Compute equivalence class as we go, 2574 instead of doing it in a separate pass; this thrashes memory less. 2575 Make buckets realloc-able, since we can't preallocate them. 2576 Record one more line start than there are lines, so that we can compute 2577 any line's length by subtracting its start from the next line's, 2578 instead of storing the length explicitly. This saves memory. 2579 Move prefix-handling code to find_identical_ends; 2580 this wins with large prefixes. 2581 Use Is_space, not is_space, for consistent treatment of white space. 2582 (prepare_text_end): New function. 2583 (find_identical_ends): Move slurping here, so it's only done when 2584 needed. Work even if the buffers are the same (because of `diff - -'). 2585 Compare prefixes a word at a time for speed. 2586 (find_equiv_class): Delete; now done by find_and_hash_each_line. 2587 (read_files): Don't slurp unless needed. 2588 find_equiv_class's work is now folded into find_and_hash_each_line. 2589 Don't copy stdin buffer if `diff - -'. 2590 Check for running out of primes. 2591 (sip, slurp): Split first part of `slurp' into another function `sip'. 2592 `sip' sets things up and perhaps reads the first ST_BLKSIZE buffer to 2593 see whether the file is binary; `slurp' now just finishes the job. 2594 This lets diff_2_files compare binary files lazily. 2595 Allocate a one-word sentinel to allow word-at-a-time prefix comparison. 2596 Count prefix lines only if needed, only count the first file's prefix. 2597 Don't bother to count suffix lines; it's never needed. 2598 Set up linbuf[0] to point at first differing line. 2599 (binary_file_p): Change test for binary files: 2600 if it has a null byte in its first buffer, it's binary. 2601 (primes): Add more primes. 2602 2603 * util.c (line_cmp): Use bcmp for speed. 2604 Use Is_space, not is_space, for consistent treatment of white space. 2605 (translate_line_number): Internal line numbers now count from 0 2606 starting after the prefix. 2607 (memchr): New function (if memchr is missing). 2608 2609 * Makefile.in: Document HAVE_ST_BLKSIZE. Link with wildmat.o. 2610 * system.h (STAT_BLOCKSIZE): New macro based on HAVE_ST_BLKSIZE. 2611 * configure.in: Add AC_ST_BLKSIZE. 2612 * wildmat.c: New file. 2613 2614Fri Sep 4 01:28:51 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) 2615 2616 * sdiff.c (xmalloc): Renamed from ck_malloc. Callers changed. 2617 2618Thu Sep 3 15:28:59 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) 2619 2620 * diff.h: Don't declare free, index, rindex. 2621 2622Tue Aug 11 22:18:06 1992 John Gilmore (gnu at cygnus.com) 2623 2624 * io.c (binary_file_p): Use heuristic to avoid declaring info 2625 files as binary files. Allow about 1.5% non-printing 2626 characters (in info's case, ^_). 2627 2628Tue Jul 7 01:09:26 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) 2629 2630 * diff.h: Replace function_regexp and ignore_regexp with lists 2631 of compiled regexps. 2632 * analyze.c, context.c, util.c: Test whether the lists, not 2633 the old variables, are empty. 2634 * util.c (analyze_hunk), context.c (find_function): Compare 2635 lines with the lists of regexps. 2636 * diff.c (add_regexp): New function. 2637 (main): Use it. 2638 2639 * diff3: Add -v --version option. 2640 * Makefile.in: Link with version.o. 2641 2642 * system.h: New file. 2643 * diff.h, cmp.c, diff3.c, sdiff.c: Use it. 2644 2645 * diff.h, diff3.c: Include string.h or strings.h, as appropriate. 2646 Declare malloc and realloc. 2647 2648 * diff3.c (perror_with_exit): Include program name in message. 2649 2650 * diff3.c: Lowercase error messages for GNU standards. 2651 2652 * sdiff.c [USG || STDC_HEADERS]: Define bcopy in terms of memcpy. 2653 2654 * sdiff.c: Use the version number from version.c. 2655 * Makefile.in: Link with version.o. 2656 2657 * cmp.c error.c xmalloc.c: New files from textutils. 2658 * Makefile.in: Add rules for them. 2659 2660 * diff.c (longopts): --unidirectional-new-file is like -P, not -N. 2661 Rename --file-label to --label (leave old name, but undocumented). 2662 2663 * sdiff.c, diff.c (usage): Condense messages and fix some errors. 2664 2665 * diff3.c (main, usage): Add long-named options. 2666 2667Fri Jul 3 14:31:18 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) 2668 2669 * diff.h, diff3.c, sdiff.c: Change FOO_MISSING macros to HAVE_FOO. 2670 2671Thu Jun 25 16:59:47 1992 David J. MacKenzie (djm@apple-gunkies.gnu.ai.mit.edu) 2672 2673 * diff.c: --reversed-ed -> --forward-ed. 2674 2675Wed Feb 26 12:17:32 1992 Paul Eggert (eggert@yata.uucp) 2676 2677 * analyze.c, diff.c, diff.h, io.c: For -y, compare even if same file. 2678 2679Fri Feb 14 22:46:38 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) 2680 2681 * io.c, diff3.c, analyze.c: Add extra parentheses. 2682 2683Sun Feb 9 00:22:42 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) 2684 2685 * diff.h (unidirectional_new_file_flag): New variable. 2686 * diff.c (main): Set that for -P. 2687 (compare_files): Support -P, somewhat like -N. 2688 (longopts): Support long name for -P. 2689 2690Sat Jan 4 20:10:34 1992 Paul Eggert (eggert at yata.uucp) 2691 2692 * Makefile.in: Distribute diff.info-* too. 2693 2694 * README, sdiff.c: version number now matches version.c. 2695 2696 * configure: Fix and document vfork test. 2697 2698 * ifdef.c: Don't dump core if `diff -Dx f f'. 2699 2700Mon Dec 23 23:36:08 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu) 2701 2702 * diff.h, diff3.c, sdiff.c: Change POSIX ifdefs to 2703 HAVE_UNISTD_H and _POSIX_VERSION. 2704 2705Wed Dec 18 17:00:31 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu) 2706 2707 * Makefile.in (srcs): Add sdiff.c. 2708 (tapefiles): Add diff.texi and diff.info. 2709 2710 * diff.h, diff3.c, sdiff.c: Use HAVE_VFORK_H instead of 2711 VFORK_HEADER and VFORK_WORKS. 2712 2713Tue Dec 17 00:02:59 1991 Paul Eggert (eggert at yata.uucp) 2714 2715 * Makefile.in (all): Add diff.info, sdiff. 2716 2717 * configure, diff.c, sdiff.c: 2718 Prefix long options with `--', not `+'. 2719 * diff.c: Regularize option names. 2720 2721 * configure: Fix check for vfork. 2722 * configure, diff.c, diff.h, diff3.c, sdiff.c: 2723 Use Posix definitions when possible. 2724 2725 * context.c: Align context with tab if -T is given. Tune. 2726 * diff.c, diff.h, side.c: Calculate column widths so that tabs line up. 2727 * io.c: Add distinction between white space and printing chars. 2728 * side.c: Don't expand tabs unless -t is given. 2729 * side.c, util.c: Tab expansion now knows about '\b', '\f', '\r', '\v'. 2730 * util.c: -w skips all white space. Remove lint. Tune. 2731 2732 * sdiff.c: Support many more diff options, e.g. `-', `sdiff file dir'. 2733 Ignore interrupts while the subsidiary editor is in control. 2734 Clean up temporary file and kill subsidiary diff if interrupted. 2735 Ensure subsidiary diff doesn't ignore SIGPIPE. 2736 Don't get confused while waiting for two subprocesses. 2737 Don't let buffers overflow. Check for I/O errors. 2738 Convert to GNU style. Tune. 2739 2740 * sdiff.c, util.c: Don't lose errno. 2741 Don't confuse sdiff with messages like `Binary files differ'. 2742 * sdiff.c, side.c: Don't assume that common lines are identical. 2743 Simplify --sdiff-merge-assist format. 2744 2745Mon Sep 16 16:42:01 1991 Tom Lord (lord at churchy.gnu.ai.mit.edu) 2746 2747 * Makefile.in, sdiff.c: introduced sdiff front end to diff. 2748 2749 * Makefile.in, analyze.c, diff.c, diff.h, io.c, side.c: Added 2750 sdiff-style output format to diff. 2751 2752Mon Aug 26 16:44:55 1991 David J. MacKenzie (djm at pogo.gnu.ai.mit.edu) 2753 2754 * Makefile.in, configure: Only put $< in Makefile if using VPATH, 2755 because older makes don't understand it. 2756 2757Fri Aug 2 12:22:30 1991 David J. MacKenzie (djm at apple-gunkies) 2758 2759 * configure: Create config.status. Remove it and Makefile if 2760 interrupted while creating them. 2761 2762Thu Aug 1 22:24:31 1991 David J. MacKenzie (djm at apple-gunkies) 2763 2764 * configure: Check for +srcdir etc. arg and look for 2765 Makefile.in in that directory. Set VPATH if srcdir is not `.'. 2766 * Makefile.in: Get rid of $(archpfx). 2767 2768Tue Jul 30 21:28:44 1991 Richard Stallman (rms at mole.gnu.ai.mit.edu) 2769 2770 * Makefile.in (prefix): Renamed from DESTDIR. 2771 2772Wed Jul 24 23:08:56 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu) 2773 2774 * diff.h, diff3.c: Rearrange ifdefs to use POSIX, 2775 STDC_HEADERS, VFORK_MISSING, DIRENT. This way it works on 2776 more systems that aren't pure USG or BSD. 2777 Don't not define const if __GNUC__ is defined -- that would 2778 break with -traditional. 2779 * configure: Check for those features. 2780 2781Wed Jul 10 01:39:23 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu) 2782 2783 * configure, Makefile.in: $(INSTALLPROG) -> $(INSTALL). 2784 2785Sat Jul 6 16:39:04 1991 David J. MacKenzie (djm at geech.gnu.ai.mit.edu) 2786 2787 * Replace Makefile with configure and Makefile.in. 2788 Update README with current compilation instructions. 2789 2790Sat Jul 6 14:03:29 1991 Richard Stallman (rms at mole.gnu.ai.mit.edu) 2791 2792 * util.c (setup_output): Just save the args for later use. 2793 (begin_output): Do the real work, with the values that were saved. 2794 It's safe to call begin_output more than once. 2795 Print the special headers for context format here. 2796 * analyze.c (diff_2_files): Don't print special headers here. 2797 * context.c (pr_context_hunk, pr_unidiff_hunk): Call begin_output. 2798 * ed.c (print_ed_hunk, print_forward_ed_hunk, print_rcs_hunk): 2799 * normal.c (print_normal_hunk): Likewise. 2800 * ifdef.c (print_ifdef_hunk): Likewise. 2801 * util.c (finish_output): Don't die if begin_output was not called. 2802 2803Thu Jun 20 23:10:01 1991 David J. MacKenzie (djm at geech.gnu.ai.mit.edu) 2804 2805 * Makefile: Add TAGS, distclean, and realclean targets. 2806 Set SHELL. 2807 2808Tue Apr 30 13:54:36 1991 Richard Stallman (rms at mole.gnu.ai.mit.edu) 2809 2810 * diff.h (TRUE, FALSE): Undefine these before defining. 2811 2812Thu Mar 14 18:27:27 1991 Richard Stallman (rms@mole.ai.mit.edu) 2813 2814 * Makefile (objs): Include $(ALLOCA). 2815 2816Sat Mar 9 22:34:03 1991 Richard Stallman (rms at mole.ai.mit.edu) 2817 2818 * diff.h: Include regex.h. 2819 2820Thu Feb 28 18:59:53 1991 Richard Stallman (rms at mole.ai.mit.edu) 2821 2822 * Makefile (diff3): Link with GNU getopt. 2823 2824Sat Feb 23 12:49:43 1991 Richard Stallman (rms at mole.ai.mit.edu) 2825 2826 * io.c (find_equiv_class): Make hash code unsigned before mod. 2827 2828 * diff.h (files): Add EXTERN. 2829 2830Sun Jan 13 21:33:01 1991 Richard Stallman (rms at mole.ai.mit.edu) 2831 2832 * diff.c: +print option renamed +paginate. Remove +all-text. 2833 2834Mon Jan 7 06:18:01 1991 David J. MacKenzie (djm at geech.ai.mit.edu) 2835 2836 * Makefile (dist): New target, replacing diff.tar and 2837 diff.tar.Z, to encode version number in distribution directory 2838 and tar file names. 2839 2840Sun Jan 6 18:42:23 1991 Michael I Bushnell (mib at geech.ai.mit.edu) 2841 2842 * Version 1.15 released. 2843 2844 * version.c: Updated from 1.15 alpha to 1.15 2845 2846 * context.c (print_context_number_range, 2847 print_unidiff_number_range): Don't print N,M when N=M, print 2848 just N instead. 2849 2850 * README: Updated for version 1.15. 2851 Makefile: Updated for version 1.15. 2852 2853 * diff3.c (main): Don't get confused if one of the arguments 2854 is a directory. 2855 2856 * diff.c (compare_files): Don't get confused if comparing 2857 standard input to a directory; print error instead. 2858 2859 * analyze.c (diff_2_files), context.c (print_context_header, 2860 print_context_script), diff.c (main), diff.h (enum 2861 output_style): Tread unidiff as an output style in its own 2862 right. This also generates an error when both -u and -c are 2863 given. 2864 2865 * diff.c (main): Better error messages when regexps are bad. 2866 2867 * diff.c (compare_files): Don't assume stdin is opened. 2868 2869 * diff3.c (read_diff): Don't assume things about the order of 2870 descriptor assignment and closes. 2871 2872 * util.c (setup_output): Don't assume things about the order 2873 of descriptor assignment and closes. 2874 2875 * diff.c (compare_files): Set a flag so that closes don't 2876 happen more than once. 2877 2878 * diff.c (main): Don't just flush stdout, do a close. That 2879 way on broken systems we can still get errors. 2880 2881Mon Dec 24 16:24:17 1990 Richard Stallman (rms at mole.ai.mit.edu) 2882 2883 * diff.c (usage): Use = for args of long options. 2884 2885Mon Dec 17 18:19:20 1990 Michael I Bushnell (mib at geech.ai.mit.edu) 2886 2887 * context.c (print_context_label): Labels were interchanged badly. 2888 2889 * context.c (pr_unidiff_hunk): Changes to deal with files 2890 ending in incomplete lines. 2891 * util.c (print_1_line): Other half of the changes. 2892 2893Mon Dec 3 14:23:55 1990 Richard Stallman (rms at mole.ai.mit.edu) 2894 2895 * diff.c (longopts, usage): unidiff => unified. 2896 2897Wed Nov 7 17:13:08 1990 Richard Stallman (rms at mole.ai.mit.edu) 2898 2899 * analyze.c (diff_2_files): No warnings about newlines for -D. 2900 2901 * diff.c (pr_unidiff_hunk): Remove ref to output_patch_flag. 2902 2903Tue Oct 23 23:19:18 1990 Richard Stallman (rms at mole.ai.mit.edu) 2904 2905 * diff.c (compare_files): For -D, compare even args are same file. 2906 * analyze.c (diff_2_files): Likewise. 2907 Also, output even if files have no differences. 2908 2909 * analyze.c (diff_2_files): Print missing newline messages last. 2910 Return 2 if a newline is missing. 2911 Print them even if files end with identical text. 2912 2913Mon Oct 22 19:40:09 1990 Richard Stallman (rms at mole.ai.mit.edu) 2914 2915 * diff.c (usage): Return 2. 2916 2917Wed Oct 10 20:54:04 1990 Richard Stallman (rms at mole.ai.mit.edu) 2918 2919 * diff.c (longopts): Add +new-files. 2920 2921Sun Sep 23 22:49:29 1990 Richard Stallman (rms at mole.ai.mit.edu) 2922 2923 * context.c (print_context_script): Handle unidiff_flag. 2924 (print_context_header): Likewise. 2925 (print_unidiff_number_range, pr_unidiff_hunk): New functions. 2926 * diff.c (longopts): Add element for +unidiff. 2927 (main): Handle +unidiff and -u. 2928 (usage): Mention them. 2929 2930Wed Sep 5 16:33:22 1990 Richard Stallman (rms at mole.ai.mit.edu) 2931 2932 * io.c (find_and_hash_each_line): Deal with missing final newline 2933 after buffering necessary context lines. 2934 2935Sat Sep 1 16:32:32 1990 Richard Stallman (rms at mole.ai.mit.edu) 2936 2937 * io.c (find_identical_ends): ROBUST_OUTPUT_FORMAT test was backward. 2938 2939Thu Aug 23 17:17:20 1990 Richard Stallman (rms at mole.ai.mit.edu) 2940 2941 * diff3.c (WIFEXITED): Undef it if WEXITSTATUS is not defined. 2942 * context.c (find_function): Don't try to return values. 2943 2944Wed Aug 22 11:54:39 1990 Richard Stallman (rms at mole.ai.mit.edu) 2945 2946 * diff.h (O_RDONLY): Define if not defined. 2947 2948Tue Aug 21 13:49:26 1990 Richard Stallman (rms at mole.ai.mit.edu) 2949 2950 * Handle -L option. 2951 * context.c (print_context_label): New function. 2952 (print_context_header): Use that. 2953 * diff.c (main): Recognize the option. 2954 (usage): Updated. 2955 * diff.h (file_label): New variable. 2956 * diff3.c (main): Recognize -L instead of -t. 2957 2958 * diff3.c (main): Support -m without other option. 2959 2960 * diff3.c (WEXITSTATUS, WIFEXITED): Define whenever not defined. 2961 2962 * diff3.c (bcopy, index, rindex): Delete definitions; not used. 2963 (D_LINENUM, D_LINELEN): Likewise. 2964 (struct diff_block): lengths includes newlines. 2965 (struct diff3_block): Likewise. 2966 (always_text, merge): New variables. 2967 (read_diff): Return address of end, not size read. Calls changed. 2968 Pass -a to diff if given to diff3. 2969 current_chunk_size now an int. Detect error in `pipe'. 2970 Check for incomplete line of output here. 2971 (scan_diff_line): Don't make scan_ptr + 2 before knowing it is valid. 2972 No need to check validity of diff output here. 2973 Include newline in length of line. 2974 (main): Compute rev_mapping here. Handle -a and -m. 2975 Error message if excess -t operands. Error for incompatible options. 2976 Error if `-' given more than once. 2977 Fix error storing in tag_strings. 2978 (output_diff3): REV_MAPPING is now an arg. Call changed. 2979 Change syntax of "missing newline" message. 2980 Expect length of line to include newline. 2981 (output_diff3_edscript): Return just 0 or 1. 2982 REV_MAPPING is now an arg. Call changed. 2983 (output_diff3_merge): New function. 2984 (process_diff): Better error message for bad diff format. 2985 (fatal, perror_with_exit): Return status 2. 2986 2987 * analyze.c (diff_2_files): Report missing newline in either 2988 or both files, if not robust output style. 2989 2990 * util.c (setup_output): Detect error from pipe. 2991 No need to close stdin. 2992 2993 * util.c (print_1_line): Change format of missing-newline msg. 2994 Change if statements to switch. 2995 2996 * io.c (slurp): Don't mention differences in final newline if -B. 2997 2998 * io.c (binary_file_p): Use ISO char set as criterion, not ASCII. 2999 3000 * io.c (find_identical_ends): Increase value of BEG0 by 1. 3001 Other changes in backwards scan to avoid decrementing pointers 3002 before start of array, and set LINES properly. 3003 3004 * diff.h (ROBUST_OUTPUT_STYLE): New macro. 3005 * io.c (find_identical_ends, find_and_hash_each_line): Use that macro. 3006 3007 * diff.h (dup2): Don't define if XENIX. 3008 3009 * diff.c (main): Check for write error at end. 3010 3011 * context.c (find_function): Don't return a value. 3012 Use argument FILE rather than global files. 3013 3014 * analyze.c: Add external function declarations. 3015 * analyze.c (build_script): Turn off explicit check for final newline. 3016 3017 * analyze.c (discard_confusing_lines): Make integers unsigned. 3018 3019Tue Jul 31 21:37:16 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) 3020 3021 * io.c (find_and_hash_each_line): Correct the criterion 3022 for leaving out the newline from the end of the line. 3023 3024Tue May 29 21:28:16 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) 3025 3026 * dir.c (diff_dirs): Free things only if nonzero. 3027 3028Mon Apr 16 18:31:05 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) 3029 3030 * diff.h (NDIR_IN_SYS): New macro controls location of ndir.h. 3031 3032 * diff3.c (xmalloc, xrealloc): Don't die if size == 0 returns 0. 3033 3034Sun Mar 25 15:58:42 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) 3035 3036 * analyze.c (discard_confusing_lines): 3037 `many' wasn't being used; use it. 3038 Canceling provisionals near start of run must handle already 3039 canceled provisionals. 3040 Canceling subruns of provisionals was canceling last nonprovisional. 3041 3042Sat Mar 24 14:02:51 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) 3043 3044 * analyze.c (discard_confusing_lines): 3045 Threshold for line occurring many times scales by square root 3046 of total lines. 3047 Within each run, cancel any long subrun of provisionals. 3048 Don't update `provisional' while canceling provisionals. 3049 In big outer loop, handle provisional and nonprovisional separately. 3050 3051Thu Mar 22 16:35:33 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) 3052 3053 * analyze.c (discard_confusing_lines): 3054 The first loops to discard provisionals from ends failed to step. 3055 In second such loops, keep discarding all consecutive provisionals. 3056 Increase threshold for stopping discarding, and also check for 3057 consecutive nondiscardables as separate threshold. 3058 3059Fri Mar 16 00:33:08 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) 3060 3061 * diff3.c (read_diff): Pass -- as first arg to diff. 3062 3063 * diff3.c: Include wait.h or define equivalent macros. 3064 (read_diff): Don't use stdio printing error in the inferior. 3065 Remember the pid and wait for it. Report failing status. 3066 Report failure of vfork. 3067 3068Sun Mar 11 17:10:32 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) 3069 3070 * diff3.c (main): Accept -t options and pass to output_diff3_edscript. 3071 (usage): Mention -t. 3072 (read_diff): Use vfork. 3073 (vfork): Don't use it on Sparc. 3074 3075 * diff.h (vfork): Don't use it on Sparc. 3076 3077Tue Mar 6 22:37:20 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) 3078 3079 * diff3.c (dup2): Don't define on Xenix. 3080 3081 * Makefile: Comments for Xenix. 3082 3083Thu Mar 1 17:19:23 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) 3084 3085 * analyze.c (diff_2_files): `message' requires three args. 3086 3087Fri Feb 23 10:56:50 1990 David J. MacKenzie (djm at albert.ai.mit.edu) 3088 3089 * diff.h, util.c, diff3.c: Change 'void *' to 'VOID *', with 3090 VOID defined as void if __STDC__, char if not. 3091 3092Sun Feb 18 20:31:58 1990 David J. MacKenzie (djm at albert.ai.mit.edu) 3093 3094 * Makefile: Add rules for getopt.c, getopt1.c, getopt.h. 3095 3096 * getopt.c, getopt.h, getopt1.c: New files. 3097 3098 * main.c (main, usage): Add long options. 3099 3100 * analyze.c (shift_boundaries): Remove unused var 'j_end'. 3101 3102Thu Feb 8 02:43:16 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) 3103 3104 * GNUmakefile: include ../Makerules before Makefile. 3105 3106Fri Feb 2 23:21:38 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) 3107 3108 * analyze.c (diff_2_files): If -B or -I, don't return 1 3109 if all changes were ignored. 3110 3111Wed Jan 24 20:43:57 1990 Richard Stallman (rms at albert.ai.mit.edu) 3112 3113 * diff3.c (fatal): Output to stderr. 3114 3115Thu Jan 11 00:25:56 1990 David J. MacKenzie (djm at hobbes.ai.mit.edu) 3116 3117 * diff.c (usage): Mention -v. 3118 3119Wed Jan 10 16:06:38 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) 3120 3121 * diff3.c (output_diff3_edscript): Return number of overlaps. 3122 (main): If have overlaps, exit with status 1. 3123 3124Sun Dec 24 10:29:20 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) 3125 3126 * io.c (find_equiv_class): Fix typo that came from changing init of B 3127 to an assignment. 3128 3129 * version.c: New file. 3130 * diff.c (main): -v prints version number. 3131 3132 * io.c (binary_file_p): Null char implies binary file. 3133 3134Fri Nov 17 23:44:55 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) 3135 3136 * util.c (print_1_line): Fix off by 1 error. 3137 3138Thu Nov 16 13:51:10 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) 3139 3140 * util.c (xcalloc): Function deleted. 3141 3142 * io.c (slurp): Null-terminate the buffer. 3143 3144 * io.c (read_files): Delete unused vars. 3145 3146 * io.c (find_equiv_class): Don't index by N if too low. 3147 3148 * dir.c (dir_sort): Delete the extra declaration of compare_names. 3149 3150 * diff.h: Don't declare xcalloc. Declare some other functions. 3151 3152 * analyze.c (shift_boundaries): 3153 Test for END at end of range before indexing by it. 3154 Fix misspelling of `preceding' in var names. 3155 3156Sat Nov 11 14:04:16 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) 3157 3158 * diff3.c (using_to_diff3_block): Delete unused vars. 3159 (make_3way_diff, process_diff_control, read_diff, output_diff3): Likewise. 3160 3161Mon Nov 6 18:15:50 EST 1989 Jay Fenlason (hack@ai.mit.edu) 3162 3163 * README Fix typo. 3164 3165Fri Nov 3 15:27:47 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) 3166 3167 * diff.c (usage): Mention -D. 3168 3169 * ifdef.c (print_ifdef_hunk): Write comments on #else and #endif. 3170 3171Sun Oct 29 16:41:07 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) 3172 3173 * diff.c (compare_files): Don't fflush for identical files. 3174 3175Wed Oct 25 17:57:12 1989 Randy Smith (randy at apple-gunkies.ai.mit.edu) 3176 3177 * diff3.c (using_to_diff3_block): When defaulting lines from 3178 FILE0, only copy up to just under the *lowest* line mentioned 3179 in the next diff. 3180 3181 * diff3.c (fatal): Add \n to error messages. 3182 3183Wed Oct 25 15:05:49 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) 3184 3185 * Makefile (tapefiles): Add ChangeLog. 3186 3187Tue Oct 3 00:51:17 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) 3188 3189 * diff3.c (process_diff, create_diff3_block): Init ->next field. 3190 3191Fri Sep 29 08:16:45 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) 3192 3193 * util.c (line_cmp): Alter end char of line 2, not line 1. 3194 3195Wed Sep 20 00:12:37 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) 3196 3197 * Makefile (diff.tar): Expect ln to fail on some files; 3198 copy them with cp. 3199 3200Mon Sep 18 02:54:29 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) 3201 3202 * Handle -D option: 3203 * io.c (find_and_hash_each_line): Keep all lines of 1st file. 3204 * diff.c (main): Handle -D option. 3205 (compare_files): Reject -D if files spec'd are directories. 3206 * analyze.c (diff_2_files): Handle OUTPUT_IFDEF case. 3207 3208Fri Sep 1 20:15:50 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) 3209 3210 * diff.c (option_list): Rename arg VECTOR as OPTIONVEC. 3211 3212Mon Aug 28 17:58:27 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) 3213 3214 * diff.c (compare_files): Clear entire inf[i].stat. 3215 3216Wed Aug 23 17:48:47 1989 Richard Stallman (rms at apple-gunkies.ai.mit.edu) 3217 3218 * io.c (find_identical_ends): Sign was backward 3219 determining where to bound the scan for the suffix. 3220 3221Wed Aug 16 12:49:16 1989 Richard Stallman (rms at hobbes.ai.mit.edu) 3222 3223 * analyze.c (diff_2_files): If -q, treat all files as binary. 3224 * diff.c (main): Detect -q, record in no_details_flag. 3225 3226Sun Jul 30 23:12:00 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) 3227 3228 * diff.c (usage): New function. 3229 (main): Call it. 3230 3231Wed Jul 26 02:02:19 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) 3232 3233 * diff.c (main): Make -C imply -c. 3234 3235Thu Jul 20 17:57:51 1989 Chris Hanson (cph at kleph) 3236 3237 * io.c (find_and_hash_each_line): Bug fix in context handling, 3238 introduced by last change. 3239 3240Fri Jul 14 17:39:20 1989 Chris Hanson (cph at kleph) 3241 3242 * analyze.c: To make RCS work correctly on files that don't 3243 necessarily end in newline, introduce some changes that cause 3244 diffs to be sensitive to missing final newline. Because 3245 non-RCS modes don't want to be affected by these changes, they 3246 are conditional on `output_style == OUTPUT_RCS'. 3247 (diff_2_files) [OUTPUT_RCS]: Suppress the "File X missing 3248 newline" message. 3249 (build_script) [OUTPUT_RCS]: Cause the last line to compare as 3250 different if exactly one of the files is missing its final 3251 newline. 3252 3253 * io.c (find_and_hash_each_line): Bug fix in 3254 ignore_space_change mode. Change line's length to include the 3255 newline. For OUTPUT_RCS, decrement last line's length if 3256 there is no final newline. 3257 (find_identical_ends) [OUTPUT_RCS]: If one of the files is 3258 missing a final newline, make sure it's not included in either 3259 the prefix or suffix. 3260 3261 * util.c (print_1_line): Change line output routine to account 3262 for line length including the newline. 3263 3264Tue Jun 27 02:35:28 1989 Roland McGrath (roland at hobbes.ai.mit.edu) 3265 3266 * Makefile: Inserted $(archpfx) where appropriate. 3267 3268Wed May 17 20:18:43 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) 3269 3270 * diff3.c [USG]: Include fcntl.h. 3271 3272 * diff.h [USG]: New compilation flags HAVE_NDIR, HAVE_DIRECT. 3273 3274Wed Apr 26 15:35:57 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) 3275 3276 * dir.c (diff_dirs): Two new args, NONEX1 and NONEX2, say to pretend 3277 nonex dirs are empty. 3278 (dir_sort): New arg NONEX, likewise. 3279 * diff.c (compare_files): Pass those args. 3280 Sometimes call diff_dirs if subdir exists in just one place. 3281 3282Wed Apr 12 01:10:27 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) 3283 3284 * io.c (find_identical_ends): Set END0 *after* last char 3285 during backward scan for suffix. 3286 3287Sat Apr 8 15:49:49 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) 3288 3289 * diff3.c (using_to_diff3_block): Now find high marks in files 1 3290 and 2 through mapping off of the last difference instead of the 3291 first. 3292 3293 * diff3.c: Many trivial changes to spelling inside comments. 3294 3295Fri Feb 24 12:38:03 1989 Randall Smith (randy at gluteus.ai.mit.edu) 3296 3297 * util.c, normal.c, io.c, ed.c, dir.c, diff.h, diff.c, context.c, 3298 analyze.c, Makefile: Changed copyright header to conform with new 3299 GNU General Public license. 3300 * diff3.c: Changed copyright header to conform with new GNU 3301 General Public license. 3302 * COPYING: Made a hard link to /gp/rms/COPYING. 3303 3304Fri Feb 24 10:01:58 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) 3305 3306 * io.c (slurp): Leave 2 chars space at end of buffer, not one. 3307 (find_identical_ends): Special case if either file is empty; 3308 don't try to make a sentinel since could crash. 3309 3310Wed Feb 15 14:24:48 1989 Jay Fenlason (hack at apple-gunkies.ai.mit.edu) 3311 3312 * diff3.c (message) Re-wrote routine to avoid using alloca() 3313 3314Wed Feb 15 06:19:14 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) 3315 3316 * io.c (find_identical_ends): Delete the variable `bytes'. 3317 3318Sun Feb 12 11:50:36 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) 3319 3320 * io.c (slurp): ->bufsize is nominal amount we have room for; 3321 add room for sentinel when calling xmalloc or xrealloc. 3322 3323 * io.c (find_identical_ends): Do need overrun check in finding suffix. 3324 3325Fri Feb 10 01:28:15 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) 3326 3327 * diff.c (main): -C now takes arg to specify context length. 3328 Now -p to show C function name--Damned IEEE! 3329 Fatal error if context length spec'd twice. 3330 3331 * ed.c (print_ed_hunk): Now special treatment only for lines containing 3332 precisely a dot and nothing else. Output `..', end the insert, 3333 substitute that one line, then resume the insert if nec. 3334 3335 * io.c (find_and_hash_lines): When backing up over starting context, 3336 don't move past buffer-beg. 3337 3338 * io.c (find_identical_ends): Use sentinels to make the loops faster. 3339 If files are identical, skip the 2nd loop and return quickly. 3340 (slurp): Leave 1 char extra space after each buffer. 3341 3342 * analyze.c (diff_2_files): Mention difference in final newlines. 3343 3344Wed Jan 25 22:44:44 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) 3345 3346 * dir.c (diff_dirs): Use * when calling fcn ptr variable. 3347 3348Sat Dec 17 14:12:06 1988 Richard Stallman (rms at sugar-bombs.ai.mit.edu) 3349 3350 * Makefile: New vars INSTALL and LIBS used in some rules; 3351 provide default defns plus commented-put defns for sysV. 3352 3353Thu Nov 17 16:42:53 1988 Richard Stallman (rms at sugar-bombs.ai.mit.edu) 3354 3355 * dir.c (dir_sort): Open-trouble not fatal; just say # files is -1. 3356 (diff_dirs): If dir_sort does that, give up and return 2. 3357 3358 * diff.c (compare_files): Don't open directories. 3359 Don't close them specially either. 3360 Cross-propagate inf[i].dir_p sooner. 3361 3362Sun Nov 13 11:19:36 1988 Richard Stallman (rms at sugar-bombs.ai.mit.edu) 3363 3364 * diff.h: Declare index, rindex. 3365 3366 * diff.c (compare_files): If comparing foodir with b/f, 3367 use foodir/f, not foodir/b/f. 3368 3369 * diff.c (compare_files): Don't print "are identical" msg for 2 dirs. 3370 Status now 1 if one file is a dir and the other isn't, etc. 3371 3372Thu Nov 3 16:30:24 1988 Randall Smith (randy at gluteus.ai.mit.edu) 3373 3374 * Makefile: Added a define for diff3 to define DIFF_PROGRAM. 3375 3376 * util.c: Added hack to make sure that perror was not called with 3377 a null pointer. 3378 3379 * diff.c: Changed S_IFDIR to S_IFMT in masking type of file bits 3380 out. 3381 3382 * diff3.c: Included USG compatibility defines. 3383 3384 * diff.h: Moved sys/file.h into #else USG section (not needed or 3385 wanted on System V). 3386 3387 * ed.c, analyze.c, context.c: Shortened names to 12 characters for 3388 the sake of System V (too simple not to do). 3389 3390 3391Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1997, 1998, 1999, 33922000, 2001, 2002 Free Software Foundation, Inc. 3393 3394This file is part of GNU Diffutils. 3395 3396This program is free software; you can redistribute it and/or modify 3397it under the terms of the GNU General Public License as published by 3398the Free Software Foundation; either version 2, or (at your option) 3399any later version. 3400 3401This program is distributed in the hope that they will be useful, 3402but WITHOUT ANY WARRANTY; without even the implied warranty of 3403MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 3404GNU General Public License for more details. 3405 3406You should have received a copy of the GNU General Public License 3407along with this program; see the file COPYING. If not, write to 3408the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 3409Boston, MA 02111-1307, USA. 3410