===== patch-2.5.9-120-g70df4e4.tar.gz ===== 2009-07-19 Andreas Gruenbacher * gl/lib/full-write.c, gl/lib/safe-write.c, gl/lib/full-write.h, gl/lib/safe-write.h, gl/m4/safe-write.m4, gl/m4/ssize_t.m4: Import full_write() and its prerequesites from gnulib. * Makefile.in (LIBSRCS, LIBHDRS, LIBM4FILES): Add new files. Add new dependencies. * configure.ac (gl_SAFE_WRITE): Needef for full_write(). * src/util.c: Include full-write.h. (copy_to_fd): use full_write() instead of write(). * src/partime.c: The -m option hasn't been officially allocated yet. Use only the long form for now (--merge). 2009-06-15 Andreas Gruenbacher * src/util.c (move_file): Don't fail when removing nonexistent files: this condition is already checked in maybe_reverse(). 2009-06-05 Andreas Gruenbacher * gl/lib/getopt_int.h, gl/lib/strndup.c, gl/m4/strndup.m4: Add some missing gnulib files. * Makefile.in (GETOPT_H): Include subdirectory (gl/lib/) when using the gnulib version. * src/patch.c: When sending output to stdout, use dup2 to redirect messages to stderr; simply assigning stderr to stdout doesn't work on some platforms. * gl/lib/dup2.c, gl/m4/dup2.m4: Import from gnulib. * gl/lib/rename.c, gl/m4/rename.m4: Import from gnulib for platforms like Mingw. 2009-05-12 Andreas Gruenbacher * src/merge.c (locate_merge): Make sure to return a line number bigger than last_frozen_line. * src/patch.c (explicit_inname): New variable. (get_some_switches): Set to true when the filename to patch has been specified on the command line. (reinitialize_almost_everything): Do not reset the input filename between patches when it has been specified on the command line. * tests/inname: New test case. * Makefile.in: Add test case. 2009-04-11 Vincent Legoll * src/patch.c (main): Always set patch_get to 0 unless PATCH_GET is set. * patch.man: Update accordingly. 2009-04-11 Andreas Gruenbacher * update-version.sh, configure.ac, Makefile.in: Portability improvements. 2009-04-08 Andreas Gruenbacher * src/patch.c (create_output_file): Add support for sending output to standard output. (main): Allow -o -. Remove redundant check. * patch.man: Document the new use of -o. * src/pch.c (there_is_another_patch): Allow special characters in filenames read interactively. * src/util.c (fetchname): Don't forget to NUL terminate ptimestr. 2009-04-07 Andreas Gruenbacher * src/util.c (file_id_hasher): Adapt to Gnulib type change. * Makefile.in: Fix out-of-tree builds. (dist): Optionally also create bzip2 and xz tarballs. * NEWS: Update. * patch.man: Replace "systems like DOS" with "Windows". Spelling. Preserve timestamps in reject files. * src/pch.c (p_timestr): New variable. (intuit_diff_type): Set p_timestr here through fetchname(). (pch_timestr): New function. * src/pch.h (pch_timestr): Declare. * src/util.c (fetchname): Return the timestamp as string when asked to. * src/util.h (fetchname): Update declaration. * tests/preserve-c-function-names, tests/reject-format: Update. 2009-04-06 Andreas Gruenbacher Fix the "patch would create" fix from 2009-03-28. * src/pch.c (maybe_reverse): New function. (intuit_diff_type): Move the check back here from there_is_another_patch(), but compute it using maybe_reverse(). If an input file name has been specified, do this check here as well. * src/patch.c (main): Only set outname if we are not skipping the patch. * src/inp.c (get_input_file): We may get here without a file to read as well now; don't abort in this case. * tests/create-delete: Add test cases covering the previously-broken code paths. * Makefile.in (MISC): Add config.guess and config.sub. * src/partime.c (parse_pattern_letter): Fix for timestamps with seconds > 59.5 from Christian Franke. 2009-04-05 Andreas Gruenbacher * util.c (create_backup): We also need to create base directories with a --prefix without slashes and a filename with slashes. A --suffix cannot contain slashes, though. * merge.c (merge_hunk): Add missing outstate->zero_output = false. Move all source and header files into src/. * Makefile.in, tests/test-lib.sh, configure.ac: Update accordingly. Move all Gnulib files below gl/, and all other source and header files into src/. * Makefile.in, tests/test-lib.sh, configure.ac, autogen.sh: Update accordingly. * m4/st_mtim.m4: Remove (obsolete since 2009-03-28). Update to the latest version of Gnulib. * config.guess, config.sub, gl/lib/getopt.hin, gl/lib/mbrtowc.c, gl/lib/stripslash.c, gl/lib/verify.h, gl/lib/xstrndup.c, gl/lib/xstrndup.h, gl/m4/argmatch.m4, gl/m4/double-slash-root.m4, gl/m4/gettext.m4, gl/m4/inline.m4, gl/m4/minmax.m4, gl/m4/xstrndup.m4: New files. * gl/lib/argmatch.c, gl/lib/argmatch.h, gl/lib/backupfile.c, gl/lib/backupfile.h, gl/lib/basename.c, gl/lib/dirname.c, gl/lib/dirname.h, gl/lib/error.c, gl/lib/error.h, gl/lib/exitfail.c, gl/lib/exitfail.h, gl/lib/getopt.c, gl/lib/getopt1.c, gl/lib/gettext.h, gl/lib/hash.c, gl/lib/hash.h, gl/lib/malloc.c, gl/lib/memchr.c, gl/lib/quote.c, gl/lib/quote.h, gl/lib/quotearg.c, gl/lib/quotearg.h, gl/lib/realloc.c, gl/lib/strcasecmp.c, gl/lib/strncasecmp.c, gl/lib/unlocked-io.h, gl/lib/xalloc.h, gl/lib/xmalloc.c: Modified. * gl/m4/backupfile.m4, gl/m4/d-ino.m4, gl/m4/dirname.m4, gl/m4/dos.m4, gl/m4/error.m4, gl/m4/exitfail.m4, gl/m4/extensions.m4, gl/m4/getopt.m4, gl/m4/hash.m4, gl/m4/malloc.m4, gl/m4/mbrtowc.m4, gl/m4/mbstate_t.m4, gl/m4/memchr.m4, gl/m4/onceonly.m4, gl/m4/quote.m4, gl/m4/quotearg.m4, gl/m4/realloc.m4, gl/m4/stdbool.m4, gl/m4/unlocked-io.m4, gl/m4/utimbuf.m4, gl/m4/xalloc.m4: Likewise. * install-sh, mkinstalldirs: Likewise. * gl/lib/stdbool.hin: Renamed from gl/lib/stdbool_.h. * gl/lib/getopt.h: Removed (should be generated). * gl/lib/addext.c: Removed from Gnulib. Replace memory_fatal() with xalloc_die(). The FILESYSTEM_PREFIX_LEN() macro has been renamed to FILE_SYSTEM_PREFIX_LEN(). * src/patch.c (main): Remove xalloc_fail_func (replaced by xalloc_die()). Work around the missing addext() with find_backup_file_name() plus hacks. * src/util.c (create_backup, version_controller): The new versions of base_name() and dir_name() return malloc'ed buffers. Adapt. * src/util.h: Replace memory_fatal() with xalloc_die(). * src/pch.c: Don't leak memory with strlen (base_name (...)). * src/util.c (create_file): Add to_dir_known_to_exist argument and try to create parent directories when set and the create failed with ENOENT. (copy_file, create_backup_copy): Pass the new to_dir_known_to_exist argument through. (create_backup): Don't assume the target directory exists when making a backup copy. * src/util.h (create_file, copy_file): Change the declarations. * src/patch.c, src/pch.c, src/inp.c: In the calls to create_file() and copy_file(), assume the parent directory exists. * tests/unmodified-files: Test the create_backup() fix. * src/util.c (create_backup): The new dir_name() and base_name() functions are really counter productive. Remove them and the bugs that keepeing them here as introduced. * tests/backup-prefix-suffix: Add more regression tests. * src/patch.c (locate_hunk): Revert to the original asymmetric hunk behavior (but only anchor hunks starting at line 0 to the start of the file): there is not enough reason to change the historic behavior. * src/merge.c (locate_merge): Add similar asymmetric hunk check here. * tests/asymmetric-hunks: Update accordingly. * patch.man: Document the asymmetric hunk behavior. * NEWS: Update. Copyright notice updates. * README, AUTHORS: Updates. * patch.man: Document that merging can be slow. * tests/test-lib.sh: Also unset QUOTING_STYLE. ===== patch-2.5.9-81-gaad98f0.tar.gz ===== 2009-04-04 Andreas Gruenbacher * pch.c (another_hunk): Add (back) the line number ranges to the debug output. * merge.c (merge_hunk): Likewise. (locate_merge): Add a note about the algorithm's requirements. * util.c (create_backup): Split from move_file. New LEAVE_ORIGINAL argument for copying instead of renaming. Don't fail when rename fails with errno == EXDEV; copy and unlink in that case instead. (copy_file): Add debug message. * util.h: Move including etc. here from patch.c. (create_backup): Declare. * patch.c (main): Create backup files even for files which did not actually change; some users of patch rely on the presence of backup files when patch says "patching file". * tests/unmodified-files: Test the patch.c change. (The EXDEV fix in create_mackup() was tested manually.) * util.c (copy_to_fd, ask): The read() return type is ssize_t. 2009-04-03 Andreas Gruenbacher * patch.man: Document the -m or --merge option. Some minor other changes. * NEWS: Document the asymmetric hunk behavior and the -m or --merge option. * merge.c (locate_merge): Include the number of changes in the debug message. (print_linerange): New function. (merge_result): No longer print line offsets: without exact matches, line numbers are less meaningful. Output the entire messages here. (merge_hunk): Be silent when merging exact matches unless in --verbose mode. * tests/merge: Add another interesting test case. * tests/test-lib.sh: Add have_ed function for checking if ed is available. * tests/crlf-handling, tests/need-filename: Check for ed and skip the ed related tests if we don't have it. * tests/merge: Use sed instead of ed: sed is more readily available. * patch.c (locate_hunk): If a hunk starts at a line > 1, it obviously is not from the start of the file. * tests/asymmetric-hunks: Add tests for all possible cases. 2009-04-02 Andreas Gruenbacher * patch.c (locate_hunk): Revert the assymmetric hunk fix from 2009-03-29. Instead, allow such hunks to apply only when no more context remains. * patch.c (main): Restructure to get rid of some code duplication. (copy_till, similar): Export these functions. * common.h (struct outstate, in_offset, out_offset, last_frozen_line): Move here from patch.c. (apply_hunk, copy_till, similar): Declare here. Simple merge support: * configure.ac (ENABLE_MERGE): New --disable-merge option. * patch.c (merge): New variable. (main): New -m and --merge options. When in merge mode, don't try to reverse patches, and don't try to apply with fuzz. * common.h (merge_hunk): Declare function. * merge.c: New file containing all the merge code. * tests/merge: New test case. * Makefile.in (SRCS): Add merge.c. (OBJS): Add merge.$(OBJEXT) when merge support is enabled. (TESTS): Add test case. (COMPILE): Define ENABLE_MERGE when merge support is enabled. Locate hunks to merge more intelligently: * bestmatch.h: Shortest Edit Sequence algorithm. * merge.c (locate_merge, count_fuzz_lines): New functions. (merge_hunk): Replace simple guessing with locate_merge(). * Makefile.in (HDRS): Add bestmatch.h. * tests/merge: Only minor improvements up to now. * diffseq.h: New file (Gnulib compareseq algorithm). * minmax.h: New file (Gnulib MIN and MAX macros). * Makefile.in (HDRS): Add diffseq.h and minmax.h. * COPYING: Update to GPL version 3 because of diffseq.h. * diffseq.h: When an EQUAL_IDX macro is defined, use that instead of EQUAL. This macro takes vector indexes instead of elements as arguments. Better merge support: * patch.c, common.h (apply_hunk): Make static again. * merge.c (compute_changes): New function for computing the difference between lines in a hunk and lines in the input file. (merge_result): We may have more than one result per hunk now. (merge_hunk): Merge the hunk with the compute_changes() result. * tests/merge: Better results now. * merge.c: Add license header. * merge.c (locate_merge): The number of changes allowed permits a higher maximum merge position (max_where). * tests/merge: Add a test for this case. * merge.c (merge_hunk): Add two missing checks that were leading into failed assertions. * tests/merge: Add test cases for each of these checks. * Makefile.in (install, uninstall): DESTDIR specifies a prefix to the root directory to install into. (installdirs): Merge with install. ===== patch-2.5.9-59-g106fcaa.tar.gz ===== 2009-04-02 Andreas Gruenbacher * patch.c (locate_hunk): Revert the assymmetric hunk fix from 2009-03-29. Instead, allow such hunks to apply only when no more context remains (and the hunk has become symmetric). 2009-04-01 Andreas Gruenbacher * tests/test-lib.sh: When $GDB is set, run patch in gdbserver for debugging. * pch.c (another_hunk): Make the debug output easier to read. 2009-03-31 Andreas Gruenbacher * patch.c: Split last_offset into in_offset and out_offset and count line numbers properly. * tests/line-numbers: Without the fixes, this test case goes horribly wrong. * Makefile.in (TESTS): Add test case. 2009-03-30 Jim Meyering tests: accommodate ls' "alternate access control method" indicator ls can output an additional byte after a file's permissions string, e.g., rather than "rwxr--r-- ..." it can output "rwxr--r--+ ..." or "rwxr--r--. ..." to indicate the presence of an ACL. * tests/create-delete: Adjust sed filter to accommodate that. * tests/preserve-mode-and-timestamp: Likewise. 2009-03-30 Andreas Gruenbacher * tests/test-lib.sh: Unset environment variables that influence the behavior of patch. * util.c (move_file): Add debug message when files have been seen already. Fix leftover "empty uneadable" debug message. * patch.c (main): Print newline earlier. * util.c (copy_file): Add debug message. 2009-03-29 Andreas Gruenbacher * patch.c (locate_hunk): Hunks that have fewer or more lines of context at the beginning than at the end can match anywhere; the assumption that this can only occur at the beginning or end of the file is wrong. Remove those checks. * tests/asymmetric-hunks: New test case. * Makefile.in (TESTS): Add test case. * util.c (move_file): Create backup files of nonexisting files with the default mode instead of mode 0: files with mode 0 cause too many problems with applications which do not expect unreadable files. * tests/create-delete: Test for this. * Makefile.in (BROKEN_TESTS): Test cases which fail. 2009-03-28 Andreas Gruenbacher * pch.c (intuit_diff_type): Rename need_filename argument to need_header. Omit superfluous "missing header" warnings. When remembering files including timestamps, we need to update the timestamps after appending to a file. This causes problems on some systems where the timestamps returned by fstat() after appending are not up to date, yes. We only remember timestamps as a compatibility hack with non-POSIX systems that do not have unique inode numbers; drop this hack instead. * timespec.h, m4/timespec.m4: Remove. * util.c: Remove timespec.h and all uses of struct timespec. (append_to_file): Remove REMEMBER argument; no need to update known files anymore. * util.h (append_to_file): Update definition. * Makefile.in: Remove timespec.h and m4/timespec.m4. * common.h (origsuff): New variable. * patch.c (main): Remember when -z was used. * util.c (contains_slash): New function. (move_file): Enforce simple backup mode and compute the backup file name here if -B, -Y, or -z is used. Fix the case where -B or -Y is combined with -z. * patch.man: Document this change. * tests/backup-prefix-suffix: New test case. * Makefile.in (TESTS): Add test case. * tests/munged-context-format: New test case. * Makefile.in (TESTS): Add test case. * util.c (vsay): New function for use in say(), etc. (ok_to_reverse): Use vsay() here instead of fprintf() to ensure flushing. * pch.c (there_is_another_patch): Move the "patch would create" test here from intuit_diff_type() after asking for the filename to patch. * inp.c (get_input_file): No need to report when the file is missing; this is done in there_is_another_patch() already. * patch.c (main): No need to report when a patch attempts to create an exiting file, either. 2009-03-25 Andreas Gruenbacher * patch.c (main): Avoid replacing files when nothing has changed. * tests/unmodified-files: New test case. * Makefile.in (TESTS): Add test case. * patch.c (main): New apply_empty_patch variable. When applying an empty patch to a file and -o is given, copy the input file to the output file. 2009-03-24 Andreas Gruenbacher * patch.c (abort_hunk_unified, abort_hunk_context): Preserve Index lines in reject files as well. * tests/reject-format: Test this change. * configure.ac (TEST_SHELL): New substitution. * Makefile.in (TEST_SHELL): New variable. (HAVE__BOOL): New variable. (hash.$(OBJEXT)): Add $(STDBOOL_H) dependency. * tests/test-lib.sh: Use expr for arithmetic operations. Check for working "echo -n" and BASH_LINENO. Replace printf with echo. * tests/preserve-mode-and-timestamp: Ignore leading "+" in ls output. * tests: Remove !shebang line from tests and make them non-executable. Replace printf with echo. 2009-03-23 Andreas Gruenbacher * patch.c (intuit_diff_type): When looking for an ed or normal patch, don't look for filename headers. (Those formats don't have any.) * pch.c (there_is_another_patch): Don't suggest to use -p with normal format diffs for the same reason. 2009-03-22 Andreas Gruenbacher * NEWS: Update for alpha release. * patch.c (main): Always initialize the known files table. Move new reject files into place; append to known ones. * util.c (file_already_seen): Export. (move_file): Remember all files, not only backup files. (append_to_file): When asked to remember a file, remember the state *after* appending. (The timestamps will change!) * tests/remember-reject-files: New test case. * Makefile.in (TESTS): Add test case. * common.h (no_strip_trailing_cr): New variable. * patch.c: Use no_strip_trailing_cr. Option --binary no longer a no-op on POSIX systems. * patch.man: Document change of --binary. * pch.c (there_is_another_patch): Check no_strip_trailing_cr. * tests/crlf-handling: Add --binary tests here. * patch.c (apply_hunk): Use fputs() in simple fprintf() situations. * patch.c (main): Require filename in patch if none specified on the command line and posixly_correct is false. * pch.c (intuit_diff_type): While we still don't have a filename, don't look for hunks. (there_is_another_patch): Pass need_filename through. * tests/need-filename: New test case. * Makefile.in (TESTS): Add test case. * pch.c (intuit_diff_type): Check for garbage after what looks like a normal format command. * tests/normal-garbage: New test case. * Makefile.in (TESTS): Add test case. * Makefile.in (bindir): Define as @bindir@. (DISTFILES_CLEAN): Move DISTFILES here which must not be remade by the dist target. (MISC): Add missing tests/test-lib.sh and update-version.sh. (check, $(TESTS)): Make each test depend on all so that they can be run individually. (maintainer-clean): Also remove patch-*.tar.gz and patch-*.tar.gz.sig. (dist): Add PV directory level. Add reminder to self how to upload. * configure.ac: Silence "missing datarootdir" warning. * tests/crlf-handling: Add test for "diff -p" context with a CRLF ine ending. 2009-03-21 Andreas Gruenbacher * patch.c (main): With -r, instead of moving the global reject file into place, copy the first reject into the file, and append all the rest. Discard rejects with -r -. * patch.man: Document the latter. * util.c (copy_to_fd): New function. (copy_file): Use that. (append_to_file): New function. * util.h (append_to_file): Add function declaration. * tests/global-reject-files: New test case. * Makefile.in (TESTS): Add test case. * patch.man: Minor fix. * pch.c (another_hunk, pch_swap): Always add the '^' hunk end marker: apply_hunk() and abort_hunk_unified() rely on it. (pch_char): Explain when this returns '\n'. * util.c: Remove unused include . 2009-03-20 Andreas Gruenbacher * patch.c: New option --reject-format=FORMAT. (abort_hunk_context): Rename from abort_hunk(). (abort_hunk_unified, abort_hunk, mangled_patch, print_unidiff_range): New functions. * patch.man: Document this. * pch.c, pch.h (pch_normalize): New function. * tests/reject-format: New test case. * Makefile.in (TESTS): Add test case. * tests/preserve-c-function-names: Update. * pch.c (p_name): New variable. (intuit_diff_type): Save the old, new, and index filenames. (pch_char): Return either of the saved filenames. * pch.h: Move enum nametype here from pch.c. Declare pch_name(). * patch.c (abort_hunk, abort_hunk_unified, abort_hunk_context): New HEADER and REVERSE arguments. (print_header_line): New function. (abort_hunk_unified, abort_hunk_context): Use it. * tests/corrupt-reject-files, tests/preserve-c-function-names, tests/reject-format: Update. * patch.c (main): No longer set reject file modes to the modes of the files they are assiciated with: the previous behavior is inconsistent with global reject files (-r), which are not associated with any particular file. * tests/preserve-mode-and-timestamp: New test case. * Makefile.in (TESTS): Add test case. * Makefile.in (DISTFILES): Add the files from DISTFILES_M4, DISTFILES_PC, DISTFILES_PC_DJGPP. (DISTFILES_M4, DISTFILES_PC, DISTFILES_PC_DJGPP): Remove. (distclean): Also remove config.hin~ and autom4te.cache/. (maintainer-clean): Also remove aclocal.m4, config.hin, configure. (dist): Make work for DISTFILES in subdirectories. Normalize and sort DISTFILES. * Makefile.in (MISC): Add VERSION. (FORCE): New target. (VERSION): Recompute automatically from repository. (configure): Depend on VERSION. Regenerate with --force: autoconf does not recognize the dependency between VERSION and ocnfigure. (config.hin): Regenerate with --force. (maintainer-clean): Also remove VERSION. * configure.ac: Compute PACKAGE_VERSION from repository. * update-version.sh: New file. * README-alpha: New file. * Makefile.in (dist): Add README-alpha when appropriate. * Makefile.in (M4FILES): Rename from ACINCLUDE_INPUTS. (aclocal.m4): Recompute with aclocal. * tests/test-lib.sh: Add library for simple test scripts. * tests/crlf-handling, tests/remember-backup-files: New test cases. * Makefile.in (TESTS): New variable. Add test cases. (check): Replace the dummy test target with running all TESTS. * pch.c, pch.h (pch_c_function): New function. * pch.c (p_c_function): New variable. (another_hunk): Preserve the "diff -p" output. * patch.c (abort_hunk): Use pch_c_function(). * tests/preserve-c-function-names: New test case. * Makefile.in (TESTS): Add test case. * util.c (savebuf): Return NULL if size == 0. * pch.c (another_hunk): Check size for size != 0 before checking savebuf()'s return value. * tests/no-newline-triggers-assert: New test case. * Makefile.in (TESTS): Add test case. * tests/corrupt-reject-files: new test case for Jim Meyering's 2007-08-26 fix. * Makefile.in (TESTS): Add test case. 2009-03-19 Andreas Gruenbacher Imported from Paul Eggert's working directory: * exitfail.c, exitfail, m4/exitfail.m4: Import from gnulib. * hash.c, hash.h, m4/hash.m4: Likewise. * m4/extensions.m4: Likewise. * timespec.h, m4/timespec.m4: Likewise. * m4/st_mtim.m4: New file. * configure.ac: Update. * common.h: Include unconditionally. Include if we have it. * inp.c (plan_b, ifetch): Remove unnecessary casts. * maketime.c, partime.c: Include , , unconditionally. Convert from K&R to ANSI C. * maketime.h, partime.h: Convert from K&R to ANSI C. * pch.c (p_indent, pget_line, intuit_diff_type): Use size_t for indents. * util.c: Assume we have vfprintf(). (NUM_SIGS): Cast to int in. (fatal_exit_handler): Replace obsolescent AC_RETSIGTYPE. * Various files: Update copyright notices. 2007-08-26 Jim Meyering * pch.c (another_hunk): Avoid an off-by-one error that would result in NUL bytes in .rej files. 2004-07-21 Paul Eggert * Makefile.in (SRCS): Move hash.c here from LIBSRCS. (exitfail.$(OBJEXT), patch.$(OBJEXT), xmalloc.$(OBJEXT)): Depend on exitfail.h. (hash.$(OBJEXT), util.$(OBJEXT)): Depend on hash.h. * util.c: Whitespace cleanup in file_id. 2004-07-19 Stepan Kasal * pch.c (get_ed_command_letter): Allow commands without address. 2003-11-10 Manu B Trivial change to port to mingw, which declares mkdir in unistd.h. * m4/mkdir.m4 (PATCH_FUNC_MKDIR_TAKES_ONE_ARG): Include unistd.h. * common.h (mkdir): Define after including unistd.h. 2003-09-11 Paul Eggert * pch.c (do_ed_script): Adjust to copy_file signature change. * Makefile.in (STDBOOL_H): New macro. All uses of @STDBOOL_H@ changed. (SRCS): Add exitfail.c. (OBJS): Add exitfail.$(OBJEXT). (HDRS): Add exitfail.h. (stdbool.h): Use $@, as gnulib now suggests. (ACINCLUDE_INPUTS): Add exitfail.m4, extensions.m4. * common.h: Include , unconditionally. * configure.ac (gl_USE_SYSTEM_EXTENSIONS): Use this instead of AC_GNU_SOURCE. (gl_EXITFAIL): Add. * patch.c: Include exitfail.h. (main): Set exit_failure, not xalloc_exit_failure. * inp.c (get_input_file): Clear cs if dry run. * util.c (fetchname): Handle missing timestamps better. * Makefile.in (LIBSRCS): Add hash.c. (OBJS): Add hash.$(OBJEXT). (HDRS): Add hash.h. (MISC): Add timespec.h. (ACINCLUDE_INPUTS): Add hash.m4, st_mtim.m4, timespec.m4 (util.$(OBJEXT): Depend on timespec.h. * configure.ac (gl_HASH, gl_TIMESPEC): Add. * patch.c (spew_output): New output arg, to contain status of output file. (main): Use it to get status of output file, and pass this to move_file as needed. Initialize hash table. * util.c (file_id): New type. (file_id_hasher, file_id_comparator, init_backup_hash_table, insert_file, file_already_seen): New functions. (file_id_table): New var. (move_file): New arg FROMST; all uses changed. Do not backup a file that's already been patched. Keep track of files that have been patched. (copy_file): New arg TOST; all uses changed. * util.h (copy_file, move_file): Adjust decls as per above. (init_backup_hash_table): New decl. 2003-07-05 Paul Eggert * Makefile.in (check): Add a trivial check that "patch --help" works. From a suggestion by Ed Avis. 2003-07-02 Paul Eggert * pch.c (intuit_diff_type): If a unified-diff header line contains trailing CR, strip CR from each body line. This corrects a bug introduced in the 2003-05-18 patch. Bug reported by Andreas Gruenbacher. * mkdir.c, rmdir.c, m4/rmdir.m4: Remove; we no longer need to worry about ancient hosts that lack these functions. * addext.c, backupfile.c, backupfile.h, dirname.h, m4/backupfile.m4, m4/onceonly.m4, m4/quote.m4, malloc.c, quote,c, quote.h, realloc.c, strcasecmp.c, xalloc.h, xmalloc.c: Sync with gnulib. * stdbool_.h: Renamed from stdbool.h.in; all uses changed. This renaming is imported from gnulib. * m4/strcase.m4: New file, imported from gnulib. * Makefile.in (LIBSRCS): Remove mkdir.c and rmdir.c. (stdbool.h): Put output into temporary file and then rename it; this change is imported from gnulib. (mostlyclean): Clean stdbool.h-t too. (ACINCLUDE_INPUTS): Remove rmdir.m4. Add strcase.m4. * configure.ac (gl_FUNC_RMDIR): Remove. (jm_PREREQ_ADDEXT): Remove; now down by gl_BACKUPFILE. (gl_STRCASE, gl_XALLOC): Add. (AC_REPLACE_FUNCS): Remove mkdir, strcasecmp. ===== patch-2.5.9.tar.gz =====