📄 changelog
字号:
(ok_to_reverse): Remove decl. * patch.c (noreverse): Now extern. (main): New environment var PATCH_VERSION_CONTROL overrides VERSION_CONTROL. Don't assert(hunk) if we're skipping the patch; we may not have any hunks. When removing a file, back it up if backups are desired. Don't chmod output file if input file did not exist. chmod rej file to input file's mode minus executable bits. (locate_hunk): Go back to old way of a single fuzz parameter, but handle it more precisely: context diffs with partial contexts can only match file ends, since the partial context can occur only at the start or end of file. All callers changed. (create_output_file): Use create_file to create files. (ok_to_reverse): Move to util.c. * inp.c (scan_input, get_input_file): Quote file names in diagnostics. (get_input_file): Set inerrno if it's not already set. Don't create file; it's now the caller's responsibility. (plan_b): Use /dev/null if input size is zero, since it might not exist. Use create_file to create temporary file. * NEWS: Add PATCH_VERSION_CONTROL; DOS port is untested. * pc/djgpp/config.h: Add comment for mode_t. * pc/djgpp/README: Note that it's not tested. * patch.man: PATCH_VERSION_CONTROL overrides VERSION_CONTROL.1997-05-15 Paul Eggert <eggert@twinsun.com> * configure.in: Add AC_PREREQ(2.12). (VERSION): Bump to 2.2.8. (ed_PROGRAM): Rename from ED_PROGRAM. * pch.c (prefix_components): Support DOS file names better. Fix typo that caused fn to almost always yield 0. * util.c (<time.h>, <maketime.h>): Include. (move_file, copy_file): Add support for DOS filenames. Preserve mode of input files when creating temp files. Add binary file support. (doprogram, rmdir): New functions. (mkdir): Use doprogram. (replace_slashes): Add support for DOS filenames. (removedirs): New function. (init_time)): New function. (initial_time): New var. (fetchname): Add support for deleted files, DOS filenames. * basename.c (FILESYSTEM_PREFIX_LEN, ISSLASH): New macros, for DOS port. (base_name): Use them. * addext.c (HAVE_DOS_FILE_NAMES): New macro. <limits.h>: Include if HAVE_LIMITS_H. (addext): Handle hosts with DOS file name limits. * common.h (LONG_MIN): New macro. (FILESYSTEM_PREFIX_LEN, ISSLASH): New macros, for DOS port. (ok_to_create_file): Remove. (reverse): Now int. (ok_to_reverse): New function decl. (O_WRONLY, _O_BINARY, O_BINARY, O_CREAT, O_TRUNC): New macros. (binary_transput): New var decl. * Makefile.in (ed_PROGRAM): Renamed from ED_PROGRAM. (CONFIG_HDRS, CONFIG_STATUS): New vars. (SRCS): Add maketime.c, partime.c. (OBJS): Likewise. (HDRS): Add maketime.h, partime.h. (DISTFILES_PC, DISTFILES_PC_DJGPP): New vars. (Makefile, config.status): Use CONFIG_STATUS, not config.status. (clean): Remove */*.o. (dist): Add pc and pc/djgpp subdirectories. ($(OBJS)): Depend on $(CONFIG_HDRS) instead of config.h. (maketime.o, partime.o): New rules. (util.o): Depend on maketime.h. * patch.c (main): Call init_time. Add DEFAULT_VERSION_CONTROL hook for people who prefer the old ways. Build temp file names before we might invoke cleanup. Add support for deleted files and clean up the patch-swapping code a bit. Delete empty ancestors of deleted files. When creating temporaries, use file modes of original files. (longopts, get_some_switches): New option --binary. (get_some_switches): Report non-errno errors with `fatal', not `pfatal'. (create_output_file): New function, which preserves modes of original files and supports binary transput. (init_output, init_reject): Use it. (ok_to_reverse): New function. (TMPDIR): New macro. (make_temp): Use $TMPDIR, $TMP, $TEMP, or TMPDIR, whichever comes first. * pch.c (p_says_nonexistent): New var. (open_patch_file): Add binary transput support. Apply stat to file names retrieved from user. Reject them if they don't exist. (intuit_diff_type): Add support for deleting files. Don't treat trivial directories any differently. Avoid stating the same file twice in common case of context diffs. (prefix_components): Don't treat trivial directories any differently. Add support for DOS filenames. (pch_says_nonexistent): New function. (do_ed_script): Preserve mode of input files when creating temp files. Add support for binary transput. * pch.h (pch_says_nonexistent): New decl. * util.h (replace_slashes): No longer exported. (fetchname): Add support for deleted files. (copy_file, move_file): Add support for preserving file modes. (init_time, removedirs): New functions. * argmatch.c: Converge with fileutils. * backupfile.c: Converge with fileutils. (find_backup_file_name): Treat .~N~ suffix just like any other suffix when handling file names that are too long. * inp.c: In messages, put quotes around file names and spaces around "--". (get_input_file): Allow files to be deleted. Do the expense of makedirs only if we can't create the file. (plan_a, plan_b): Add support for binary transput. * pc/chdirsaf.c, pc/djgpp/README, pc/djgpp/config.h, pc/djgpp/config.sed, pc/djgpp/configure.bat, pc/quotearg.c: New file. * NEWS: New methods for removing files; adjust file name intuition again. Add description of MS-DOS and MS-Windows ports. * patch.man: Simplify file name intuition slightly (no distinction for trivial dirs). Add --binary. Describe how files and directories are deleted. Suggest diff -a. Include caveats about what context diffs cannot represent.1997-05-06 Paul Eggert <eggert@twinsun.com> * configure.in (VERSION): Now 2.2.7. (CPPFLAGS, LDFLAGS, LIBS): If the user has not set any of these vars, prefer support for large files if available. * common.h (_LARGEFILE_SOURCE): Define. (file_offset): New typedef. (file_seek, file_tell): New macros. * patch.c (main): Remove empty files by default unless POSIXLY_CORRECT is set. * util.c, util.h (Fseek): Use file_offset instead of long, for portability to large-file hosts. * pch.c: (p_base, p_start, next_intuit_at, skip_to, open_patch_file, intuit_diff_type, another_hunk, incomplete_line, do_ed_script): Use file_offset instead of long, for portability to large-file hosts. (prefix_components): Renamed from path_name_components; count only nontrivial prefix components, and take a 2nd EXISTING arg. (existing_prefix_components): Remove; subsumed by prefix_components. (intuit_diff_type): When creating files, try for the creation of the fewest directories. * configure.in (VERSION): Now 2.2.6. * pch.c (existing_prefix_components): New function. (intuit_diff_type): When creating a file, use a name whose existing directory prefix contains the most nontrivial path name components. (best_name): Don't check for null 2nd arg. * util.h (replace_slashes): New decl. * util.c (replace_slashes): Now external. (fetchname): Don't assume chars are nonnegative. * patch.man: When creating a file, use a name whose existing directory prefix contains the most nontrivial path name components. Add advice for creating patches and applying them.1997-05-06 Paul Eggert <eggert@twinsun.com> * configure.in (VERSION): Now 2.2.6. * pch.c (existing_prefix_components): New function. (intuit_diff_type): When creating a file, use a name whose existing directory prefix contains the most nontrivial path name components. (best_name): Don't check for null 2nd arg. * util.h (replace_slashes): New decl. * util.c (replace_slashes): Now external. (fetchname): Don't assume chars are nonnegative. * patch.man: Describe above change to pch.c. Add advice for creating patches and applying them.1997-05-05 Paul Eggert <eggert@twinsun.com> * configure.in (VERSION): Update to 2.2.5. * quotearg.h, quotearg.c: New files. * Makefile.in (SRCS, OBJS, HDRS): Mention new files. (inp.o, util.o): Now depends on quotearg.h. (quotearg.o): New makefile rule. * common.h (posixly_correct): New var. * patch.c (main): Initialize it. If ! posixly_correct, default backup type is now `existing'. SIMPLE_BACKUP_SUFFIX no longer affects backup type. (backup): Remove var. * util.h: (countdirs): Remove. (systemic): New decl. * util.c (move_file): Try making the parent directory of TO if backup prefix or suffix contain a slash. (ask): Remove arbitrary limit on size of result. (systemic): New function. (mkdir): Work even if arg contains shell metacharacters. (replace_slashes): Return 0 if none were replaced. Don't replace slash after . or .. since it's redundant. (countdirs): Remove. (makedirs): Ignore mkdir failures. * NEWS, patch.man: More POSIXLY_CORRECT adjustments. Describe new rules for how file names are intuited.1997-04-17 Paul Eggert <eggert@twinsun.com> * configure.in (VERSION): Version 2.2 released. * Makefile.in (config.hin): Remove before building; we always want the timestamp updated. * inp.c (get_input_file): Look for RCS files only if backup_type == numbered_existing. * NEWS, patch.man: Remove mention of never-implemented -V rcs and -V sccs options. * patch.man: `pathname' -> `file name' Correct the description of how file names are found in diff headers. Clarify the distinction between ordinary and unified context diffs.1997-04-13 Paul Eggert <eggert@twinsun.com> * configure.in (VERSION): Update to 2.1.7. * patch.c (numeric_optarg): New function. (get_some_switches): Use it. * pch.c (intuit_diff_type): When creating a file, prefer a name whose existing dir prefix is the longest. * util.h (countdirs): New function. * util.c (replace_slashes, countdirs): New functions. (makedirs): Use replace_slashes, to be more like countdirs. * patch.man: Explain -pN vs -p N. Recommend --new-file. Explain possible incompatibility with strip count.1997-04-10 Paul Eggert <eggert@twinsun.com> * configure.in (VERSION): Bump to 2.1.6. (AC_CHECK_HEADERS): Remove stdlib.h (i.e. remove HAVE_STDLIB_H). * Makefile.in: (HDRS, patchlevel.h, TAGS, distclean, maintainer-clean): Don't distribute patchlevel.h; let the user do it. This works around some obscure (possibly nonexistent?) `make' bugs. * common.h (program_name): extern, not XTERN. (<stdlib.h>): Include if STDC_HEADERS, not if HAVE_STDLIB_H. (atol, getenv, malloc, realloc): Don't worry whether they're #defined. * patch.c (get_some_switches): Add special hack for backwards compatibility with CVS 1.9. (-B, -Y, -z): Now set backup_type = simple. * NEWS: Fix misspellings; minor reformatting. * README: Report POSIX.2 compliance.1997-04-06 Paul Eggert <eggert@twinsun.com> Move all old RCS $Log entries into ChangeLog. #include all files with < >, not " ". * addext.c, argmatch.c, argmatch.h, memchr.c, install-sh: New files. * EXTERN.h, INTERN.h: Removed. * config.hin: Renamed from config.h.in. * acconfig.h (NODIR): Remove. (HAVE_MEMCHR): Add. * configure.in (AC_ARG_PROGRAM, AC_PROG_MAKE_SET, HAVE_MEMCHR): Add. (AC_CHECK_HEADERS): Replaces obsolescent AC_HAVE_HEADERS. Add stdlib.h, string.h, unistd.h, varargs.h. Delete obsolete call to AC_UNISTD_H. (AC_CONFIG_HEADER): Rename config.h.in to config.hin. (AC_C_CONST): Replaces obsolescent AC_CONST. (AC_CHECK_FUNC): Check for getopt_long; define LIBOBJS and substitute for it accordingly. (AC_CHECK_FUNCS): Replaces obsolescent AC_HAVE_FUNCS. Add _doprintf, isascii, mktemp, sigaction, sigprocmask, sigsetmask. Remove strerror. (AC_FUNC_CLOSEDIR_VOID, AC_FUNC_VPRINTF): Add. (AC_HEADER_DIRENT): Replaces obsolescent AC_DIR_HEADER. (AC_HEADER_STDC): Replaces obsolescent AC_STDC_HEADERS. (AC_SYS_LONG_FILE_NAMES): Replaces obsolescent AC_LONG_FILE_NAMES. (AC_TYPE_OFF_T): Replaces obsolescent AC_OFF_T. (AC_TYPE_SIGNAL): Replaces obsolescent AC_RETSIGTYPE. (AC_TYPE_SIZE_T): Replaces obsolescent AC_SIZE_T. (AC_XENIX_DIR): Remove. (ED_PROGRAM): New var. (NODIR): Remove. (PACKAGE, VERSION): New vars; substitute them with AC_SUBST. * Makefile.in: Conform to current GNU build standards. Redo dependencies. Use library getopt_long if available. Use `&&' instead of `;' inside shell commands where applicable; GNU make requires this. Use double-colon rules for actions that do not build files. (@SET_MAKE@): Added. (CFLAGS, LDFLAGS, prefix, exec_prefix): Base on @ versions of symbols. (COMPILE, CPPFLAGS, DEFS, ED_PROGRAM, LIBOBJS, LIBSRCS, PACKAGE, VERSION): New symbols. (SRCS, OBJS, HDRS, MISC): Add new files. (man1dir): Renamed from mandir. (man1ext): Renamed from manext. (patch): Put -o first. (install): Use $(transform) to allow program to be renamed by configure. (patchlevel.h): Build from $(VERSION). (dist): Get version number from $(VERSION) and package name from
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -