📄 changelog
字号:
2001-12-12 Neal H Walfield <neal@cs.uml.edu> * diff.c (option_help_msgid): Correct the default context width from 2 to 3.2001-12-11 Paul Eggert <eggert@twinsun.com> * m4/Makefile.am.in: Remove jm-glibc-io.m4 * NEWS, configure.ac (AM_INIT_AUTOMAKE): Version 2.7.5. * configure.ac (PR_PROGRAM): Use AC_DEFINE_UNQUOTED, so that $PR_PROGRAM is expanded by sh. (ptrdiff_t, ssize_t): Use AC_CHECK_TYPE with a default of int, not AC_CHECK_TYPES. (jm_AC_DOS, AC_FUNC_SETMODE_DOS): New macros. (AC_CONFIG_FILES): Add ms/Makefile. * doc/diff.texi: Add --no-ignore-file-name-case. File name case sensitivity now affects file name exclusion. Fix typos. * src/util.c: Include dirname.h. (dir_file_pathname): Use base_name rather than file_name_lastdirchar. * src/system.h (S_IXUSR, S_IXGRP, S_IXOTH): New macros. Include <libgettext.h> rather than rolling it ourselves. (file_name_lastdirchar, HAVE_SETMODE, set_binary_mode): Remove. * src/sdiff.c: Include <dirname.h>. (expand_name): Use base_name rather than file_name_lastdirchar, for portability to DOS. (main): Initialize xalloc_exit_failure before possibly invoking any memory allocator. * src/io.c: Include setmode.h. * src/diff3.c (main): Initialize xalloc_exit_failure before possibly invoking any memory allocator. * src/diff.c: Include dirname.h, setmode.h. (main): Later values and/or styles now silently override earlier. (specify_value, specify_style): Likewise. All callers changed. Remove. (binary, main, option_help_msgid, compare_files): HAVE_SETMODE -> HAVE_SETMODE_DOS. (NO_IGNORE_FILE_NAME_CASE_OPTION): New constant. (longopts, main, option_help_msgid): Support it. (exclude_options): New function. (main): Use it. Initialize xalloc_exit_failure before potentially allocating memory. (filetype): Distinguish executable files from others, as POSIX suggests. (compare_files): Use base_name instead of file_name_lastdirchar. * src/cmp.c: Include <hard-locale.h>, <setmode.h>. (hard_locale_LC_MESSAGES): New macro. (sprintc): Remove int width arg; it's now the caller's responsibility to pad. All callers changed. (stat_buf): New static var; was formerly a local var in 'main'. (valid_suffixes): Add 'K', for 'KiB'. (option_help_msgid): Don't confuse bytes with characters. (main): Set xalloc_exit_failure before invoking anything that might allocate memory. Fix bug: -n was incorrectly ignored when optimizing the case of regular files with different lengths. (cmp): Use an index column wide enough to store this comparison's indexes. In locales other than the POSIX locale, say "byte" rather than "char". * ms/config.bat: pc -> ms * ms/Makefile.am, m4/setmode.m4, lib/setmode.c, lib/setmode.h: New file. * lib/Makefile.am (noinst_HEADERS): Add dirname.h, setmode.h. (libdiffutils_a_SOURCES): Add basename.c, setmode.c. * Makefile.am (SUBDIRS): Add ms.2001-12-10 Paul Eggert <eggert@twinsun.com> * m4/fnmatch.m4: Test for FNM_CASEFOLD.2001-12-03 Paul Eggert <eggert@twinsun.com> * lib/posix/regex.h: Fix copyright notice.2001-12-03 Paul Eggert <eggert@twinsun.com> * NEWS, configure.ac (AM_INIT_AUTOMAKE): Version 2.7.4. * diff.texi (direntry, Overview, Comparison, Binary, Invoking cmp): Use "byte" rather than "character" when talking about cmp, since it compares bytes, not character. (Invoking cmp): New trailing operands FROM-SKIP and TO-SKIP. -i or --ignore-initial now accepts FROM-SKIP:TO-SKIP. New option -n or --bytes. Count operands now may be in octal or hex, and may be followed by a size multiplier. * configure.ac (DEFAULT_DIFF_PROGRAM): Define to "diff", not "$bindir/diff" (which didn't work anyway). (AC_CHECK_MEMBERS): Add struct stat.st_blksize, struct stat.st_rdev. (AC_STRUCT_ST_BLKSIZE, AC_STRUCT_ST_RDEV): Remove; obsolescent. (AC_FUNC_FORK): Use this, instead of obsolescent AC_FUNC_VFORK. (AC_CONFIG_FILES, AC_CONFIG_COMMANDS): Add. (AC_OUTPUT): Remove args; they were obsolescent. * util.c (setup_output, begin_output, finish_output): HAVE_FORK -> HAVE_WORKING_FORK || HAVE_WORKING_VFORK. * sdiff.c (diffpid, cleanup, main, edit): Likewise. * diff3.c (read_diff): Likewise. * system.h (STAT_BLOCKSIZE): Use HAVE_STRUCT_STAT_ST_BLKSIZE, not HAVE_ST_BLKSIZE. (vfork): New macro. (HAVE_FORK): Remove. (set_binary_mode): New macro. * sdiff.c (main): HAVE_VFORK -> HAVE_WORKING_VFORK. (edit): Reopen the temporary file after the editor has run, in case the editor operates by unlinking the old file and linking a new one. (P_tmpdir): Rename from PVT_tmpdir; this fixes a typo. All uses changed. * io.c (sip, read_files): Remove tests for HAVE_SETMODE; use set_binary_mode instead of setmode. (sip): Fix typo in backward lseek when reverting to text mode. * config.site, config.sed, config.bat: New file. * Makefile.am (EXTRA_DIST): Add xstrtol.c. (noinst_HEADERS): Add xstrtol.h. (libdiffutils_a_SOURCES): Add xstrtoumax.c. * cmp.c: <xstrtol.h>: Include. (ignore_initial): Now an array with 2 elements. All uses changed. (bytes): New var. (HELP_OPTION): New constant. (long_options, main): Use it. (long_options, option_help_msgid, main, cmp): Add support for -n or --bytes. (parse_ignore_initial): New function. (option_help_msgid, main): Add -i M:N. (usage, main): Add two optional trailing operands, a la BSD. (main): setmode -> set_binary_mode. (cmp): Report byte number of what we've seen, not of the entire file. This is to be consistent with the line number, which is always relative with what we've seen.2001-12-02 Paul Eggert <eggert@twinsun.com> * diff.c (main, compare_files): setmode -> set_binary_mode. * xstrtol.c (__xstrtol): Don't accept 'Ki'; require 'KiB'. * xstrtol.c (__xstrtol): Add support for IEC 60027-2.2001-11-25 Paul Eggert <eggert@twinsun.com> * NEWS, configure.ac (AM_INIT_AUTOMAKE): Version 2.7.3. * README-alpha: New file. * src/Makefile.am (INCLUDES): Add -I../lib, for regex.h. * configure.ac: Don't set LIB_CLOCK_GETTIME to 'none required'; set it to the empty string instead. * lib/Makefile.am (EXTRA_DIST): Add strtoimax.c, strtol.c. * Makefile.am (SUBDIRS): Put intl before lib, so that libintl.h exists. * lib/Makefile.am (noinst_HEADERS): Add unlocked-io.h. * configure.ac (__EXTENSIONS__): New define, for the unlocked macros. * README: Add copyright notice. Remove stuff that doesn't apply any more. * doc/diff.texi: offsets -> indices for cmp * src/cmp.c (option_help_msgid): offsets -> indices * src/diff.c (option_help_msgid): Don't mention --binary on POSIX hosts. * src/sdiff.c (STRIP_TRAILING_CR_OPTION): New constant. (longopts, option_help_msgid, main): Add -E, --ignore-tab-expansion, --strip-trailing-cr. * doc/diff.texi: Change direcategory from Utilities to GNU Packages. Add individual utilities. Switch to Free Documentation License. @code -> @command @samp -> @option GNU -> @sc{gnu} Expand tabs to spaces, except when in an example that actually uses tabs. Prefer @node with just one arg. Document -E or --ignore-tab-expansion, --strip-trailing-cr, --ignore-file-name-case. Regular expressions are now grep style, not Emacs style. cmp's -c or --print-chars option is now -b or --print-bytes. Time stamps now depend on LC_TIME. -p now implies ^[[:alpha:]$_]. Flags now include ' and 0. cmp -i is an alias for --ignore-initial Document --from-file, --to-file. Document DIFF_OPTIONS. * configure.ac (AC_CHECK_FUNCS): Add gettimeofday, clock_gettime. (LIB_CLOCK_GETTIME): New subst. * src/system.h: Assume C89 or better. (_GNU_SOURCE): Remove; config.h now defines it. (alloca): Declare like coreutils does it. (verify, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, O_RDWR, S_IRUSR, S_IWUSR): New macros. (STAT_BLOCKSIZE): Parenthesize definiens. <inttypes.h>: Include if HAVE_INTTYPES_H. (CHAR_MAX, INT_MAX): Remove. (PTRDIFF_MAX, SIZE_MAX): New macros. (strtoumax): New decl. Include stddef.h. (bzero): Remove. (bindtextdomain, textdomain, N_): New macros. (ISPRINT, ISSPACE): Remove ifndef wrappers. (ISUPPER, ISDIGIT): Remove. (TOLOWER): New macro. (MIN): Renamed from min; all callers changed. (MAX): Likewise, from max. (lin): New type. (LIN_MAX): New macro. (file_name_cmp): Renamed from filename_cmp. All callers changed. (file_name_lastdirchar): Renamed from file_name_lastdirchar. All callers changed. (could_be_mvfs_stat_bug, could_be_nfs_stat_bug, dev_may_have_duplicate_ino): Remove. (HAVE_SETMODE, NULL_DEVICE): New macros. (same_file): Do not check attributes. (same_file_attributes): New macro. * src/util.c: Assume C89 or better. int -> bool for booleans. int -> lin for line numbers. int -> size_t for sizes. Use angle-brackets when including quotesys.h. Include error.h, regex.h, xalloc.h. (message5): sizeof -> offsetof (begin_output): Invoke pr without -f. (lines_differ): Renamed from line_cmp, and return bool not 3-way int. All callers changed. Add support for IGNORE_TAB_EXPANSION. (change_letter): Now an array rather than a function. All callers changed. (translate_range): Translate line numbers to long, not lin, for convenience with printf. (analyze_hunk): Return enum changes instead of a count of inserts and deletes. All callers changed. (zalloc): New function. * src/side.c: Assume C89 or better. int -> bool for booleans. int -> lin for line numbers. * src/sdiff.c: Assume C89 or better. int -> bool for booleans. int -> lin for line numbers. Use angle-brackets when including getopt.h, quotesys.h. Include error.h, freesoft.h, stdio.h, xalloc.h. (copyright_string): Use only most recent year. (authorship_msgid, option_help_msgid): Wrap in N_(). (tmpname): Now volatile. (tmpmade): Remove. (tmp): New var. (private_tempnam, exists, letters): Remove. (temporary_file): New function. (edit): Use it. (interact): Use strtoumax, not atoi. * src/normal.c: Assume C89 or better. int -> lin for line numbers. * src/io.c: Assume C89 or better. int -> bool for booleans. int -> lin for line numbers. int -> size_t for sizes. Use angle-brackets when including cmpbuf.h. Include regex.h, xalloc.h. (word): Remove; now done in system.h. (hash_value): New type; use it instead of 'unsigned' for hash values. (file_block_read): New function. (sip, slurp): Use it. Now static. (sip): Ensure block size is a multiple of word size. Clear eof flag. (slurp): Use xalloc_die to report memory exhaustion. (find_and_hash_each_line): Use TOLOWER instead of _tolower. Add support for IGNORE_TAB_EXPANSION. (prepare_text_end): Strip trailing CR if requested. (find_identical_ends): Prepare the text only once, if they're duplicates. Let the compiler take advantage more of the fact that the buffers are word-aligned. (primes): Remove. (prime_offset): New var. (read_var): Use prime_offset instead of primes. Use zalloc instead of xmalloc + bzero. * src/ifdef.c: Assume C89 or better. int -> lin for line numbers. (format_group): Use strtoumax to parse line numbers. (format_group, print_ifdef_lines): Use do_printf_spec to handle printf specs. (groups_letter_value): Don't use _tolower; it's locale-dependent. (do_printf_spec): Renamed from scan_printf_spec; now does the printing. * src/ed.c: Assume C89 or better. int -> lin for line numbers (or 'long' when that's more convenient). (print_ed_hunk): Fix bug when handling double-dot inserts. * src/dir.c: Assume C89 or better. int -> bool for booleans. Include error.h, exclude.h, xalloc.h. (dir_sort): Return 0 on error, 1 on success. All callers changed. compare_names -> compare_names_for_qsort. (compare_names): Try strcasecmp if ignore_file_name_case. Then try strcoll. Use file_name_cmp only as a last resort. Warn about strcasecmp or strcoll failure. (compare_names_for_qsort): New function. (diff_dirs): Use compare_names rather than filename_cmp. * src/diff3.c: Assume C89 or better. int -> bool for booleans. int -> lin for line numbers. Use angle-brackets when including getopt.h, quotesys.h. Include error.h, freesoft.h, inttostr.h, xalloc.h. (copyright_string): Use only most recent year. (authorship_msgid, option_help_msgid): Wrap in N_(). Rename the following variables for consistency with user-visible
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -