| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/diff.h (no_dereference_symlinks): New variable.
* src/diff.c: Include xreadlink.h.
(longopts): Add --no-dereference option.
(main): Accept --no-dereference option.
(option_help_msgid): Mention the --no-dereference option.
(compare_files): If no_dereference_symlinks is true, use lstat()
instead of stat(). Compare symbolic links by comparing their values.
* bootstrap.conf (gnulib_modules): Add lstat, stat, xreadlink.
* doc/diffutils.texi (Comparing Directories, diff Options): Mention the
--no-dereference option.
* tests/no-dereference: New file.
* tests/Makefile.am (TESTS): Add it.
|
|
|
|
| |
Run "make update-copyright".
|
|
|
|
|
|
|
| |
* src/diff.c: Include binary-io.h, not xfreopen.h.
(main): Use SET_BINARY (...) rather than xfreopen (NULL, X, ...),
because the latter doesn't work on MinGW and crashes using MSVC.
* src/cmp.c (main): Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Derived from Roland McGrath's patch (dated June 2004!) in:
http://lists.gnu.org/archive/html/bug-gnu-utils/2004-07/msg00000.html
* NEWS:
* doc/diffutils.texi (White Space, Blank Lines)
(sdiff Option Summary, diff Options, sdiff Options): Document -Z.
* src/diff.h (IGNORE_TRAILING_SPACE)
(IGNORE_TAB_EXPANSION_AND_TRAILING_SPACE): New constants, for -Z.
* src/diff.c (shortopts, longopts, main, option_help_msgid):
* src/sdiff.c (longopts, option_help_msgid, main):
* src/io.c (find_and_hash_each_line):
* src/util.c (lines_differ, analyze_hunk): Support -Z.
|
|
|
|
|
|
|
|
|
|
|
| |
Derived from Tim Waugh's patch in:
http://lists.gnu.org/archive/html/bug-diffutils/2011-08/msg00034.html
* NEWS, doc/diffutils.texi (diff Options): Document this.
* src/diff.c (compare_files): Implement this, by using
find_dir_file_pathname.
* src/diff.h (find_dir_file_pathname): New decl.
* src/dir.c: Include filenamecat.h.
(find_dir_file_pathname): New function.
|
|
|
|
|
| |
* src/diff.c (option_help_msgid): Insert omitted comma between
"-b" and "--ignore-space-change". (tiny change)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/Makefile.am: Generate version.c and version.h and put the
new symbol in a tiny library to be used by each program.
(LDADD): Add the new library.
* src/cmp.c (main): Use Version, not PACKAGE_VERSION, so the .o
file does not change with each commit-derived version increment.
* src/diff.c (main): Likewise.
* src/diff3.c (main): Likewise.
* src/sdiff.c (main): Likewise.
* src/system.h: Include "version.h".
* .gitignore: Add version.[ch]
|
|
|
|
|
|
|
|
| |
* cmp.c (option_help_msgid, usage),
* diff.c (option_help_msgid, usage),
* diff3.c (option_help_msgid, usage),
* sdiff.c (option_help_msgid, usage): align descriptions in the --help
output and slightly edit content.
|
|
|
|
| |
* src/diff.c (option_help_msgid): Document -L.
|
|
|
|
|
| |
* src/diff.c (specify_value): Use !STREQ(...), not strcmp(...) != 0.
* src/diff3.c (main): Likewise.
|
|
|
|
| |
Run "make update-copyright", so "make syntax-check" works in 2011.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* bootstrap.conf (gnulib_modules): Add filenamecat.
* src/diff.c: Include "filenamecat.h".
(compare_files): Use file_name_concat, rather than dir_file_pathname.
* src/util.c (dir_file_pathname): Remove now-unused function.
* src/diff.h: Remove its declaration.
* tests/excess-slash: New script to test for this.
* tests/Makefile.am (TESTS): Add it.
Forwarded by Santiago Vila from <bugs.debian.org/586301a>,
reported by Jari Aalto.
|
|
|
|
|
|
|
| |
The new "stdin" test was failing on many types of systems.
* src/diff.c (compare_files): Guard use of xfreopen (NULL, "rb", ...
also with O_BINARY, so as to avoid this unnecessary call on
systems where it's not needed (on some it fails with "Bad address".
|
|
|
|
|
|
| |
Use this command:
git ls-files |grep -vE '^(\..*|COPYING|gnulib)$' |xargs \
env UPDATE_COPYRIGHT_USE_INTERVALS=1 build-aux/update-copyright
|
|
|
|
|
|
|
|
|
| |
* src/cmp.c: Include "xfreopen.h".
Use xfreopen in place of freopen.
* src/diff.c Likewise, and...
(main): Set exit_failure to EXIT_TROUBLE, rather than to 2.
* src/diff3.c: Likewise.
* bootstrap.conf (gnulib_modules): Add xfreopen.
|
|
|
|
|
|
|
|
| |
The clang static analyzer reported that a NULL parent could be
dereferenced. However, that cannot happen, because for all callers,
the parameter, parent, is always non-NULL at that point.
* src/diff.c: Include <assert.h>.
Assert that parent is not NULL.
|
|
|
|
|
|
|
|
|
|
| |
* bootstrap.conf (gnulib_modules): Add propername.
* src/cmp.c (PROGRAM_NAME, AUTHORS): Define.
(main): Use them in use of version_etc.
* src/diff.c (PROGRAM_NAME, AUTHORS, main): Likewise.
* src/diff3.c (PROGRAM_NAME, AUTHORS, main): Likewise.
* src/sdiff.c (PROGRAM_NAME, AUTHORS, main): Likewise.
* src/system.h: Include "propername.h".
|
|
|
|
|
|
|
|
|
|
|
| |
* configure.ac (AC_INIT): Use bug-diffutils@..., not bug-gnu-utils
as the bug-reporting address.
* NEWS (Administrivia): Mention this.
* src/cmp.c (usage): Remove hard-coded address.
Instead, use gnulib's emit_bug_reporting_address function.
* src/diff.c (usage, option_help_msgid): Likewise.
* src/diff3.c (usage): Likewise.
* src/sdiff.c (usage): Likewise.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
* bootstrap.conf (gnulib_modules): Add progname.
* cfg.mk (local-checks-to-skip): Add sc_program_name.
* src/cmp.c: Include progname.h.
(program_name): Remove declaration.
(main): Call set_program_name.
* src/diff.c (main): Likewise.
* src/diff3.c (main): Likewise.
* src/sdiff.c (main): Likewise.
* src/diff.h (program_name): Remove extern declaration.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Run this command:
git grep -l 'strcmp *([^=]*== *0'|xargs \
perl -pi -e 's/\bstrcmp( *\(.*?\)) *== *0/STREQ$1/g'
and then add the new definition.
* src/system.h (STREQ): Define.
* src/cmp.c (main): Use STREQ, not strcmp.
* src/diff.c (main, compare_files): Likewise.
* src/diff3.c (main): Likewise.
* src/sdiff.c (expand_name): Likewise.
* cfg.mk (local-checks-to-skip): Add sc_prohibit_strcmp.
|
|
|
|
|
|
| |
* src/diff.c (compare-files): Remove useless if stmts.
* src/dir.c (diff_dirs): Likewise.
* cfg.mk (local-checks-to-skip): Remove sc_avoid_if_before_free.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* doc/diff.texi (Detailed Unified): Trailing spaces are no longer
omitted.
(Trailing Blanks): New section.
(diff Options) Mention new option.
* src/diff.h (suppress_blank_entry): New decl.
* src/context.c (pr_unidiff_hunk): Support --suppress-blank-empty.
* src/util.c (print_1_line): Likewise.
* src/diff.c (longopts, main, option_help_msgid): Likewise.
(SUPPRESS_BLANK_EMPTY_OPTION): New constant.
|
|
|
|
|
|
| |
adjusting to gnulib API change. This avoids a memory leak.
* src/sdiff.c (expand_name): Likewise.
* src/util.c (dir_file_pathname): Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* AUTHORS: Update from GPLv2 to GPLv3.
* Makefile.am: Likewise.
* NEWS: Likewise.
* README: Likewise.
* README-hacking: Likewise.
* bootstrap: Likewise.
* bootstrap.conf: Likewise.
* configure.ac: Likewise.
* exgettext: Likewise.
* doc/Makefile.am: Likewise.
* lib/Makefile.am: Likewise.
* lib/cmpbuf.c: Likewise.
* lib/cmpbuf.h: Likewise.
* lib/prepargs.c: Likewise.
* m4/vararrays.m4: Likewise.
* man/Makefile.am: Likewise.
* ms/Makefile.am: Likewise.
* ms/README: Likewise.
* ms/config.bat: Likewise.
* ms/config.sed: Likewise.
* ms/config.site: Likewise.
* po/POTFILES.in: Likewise.
* src/Makefile.am: Likewise.
* src/analyze.c: Likewise.
* src/cmp.c: Likewise.
* src/context.c: Likewise.
* src/diff.c: Likewise.
* src/diff.h: Likewise.
* src/diff3.c: Likewise.
* src/dir.c: Likewise.
* src/ed.c: Likewise.
* src/io.c: Likewise.
* src/normal.c: Likewise.
* src/sdiff.c: Likewise.
* src/system.h: Likewise.
* src/util.c: Likewise.
|
|
|
|
|
|
|
|
|
|
| |
* src/cmp.c: Don't include exit.h; no longer needed.
* src/diff.c: Likewise.
* src/sdiff.c: Likewise.
* src/dir.c: Don't include strcase.h; no longer needed.
* README-alpha: Remove, replacing with:
* README-hacking: New file, taken from coreutils with some changes.
The rename is required by the change to 'bootstrap'.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(specify_ignore_initial): Reword to avoid gcc -W warnings.
(main): Use freopen instead of setmode, since freopen is in POSIX.
* src/context.c: Revert most 2004-09-01 changes. Then:
(TIMESPEC_NS): Remove. All uses replaced by
get_stat_mtime_ns.
Include stat-time.h, strftime.h.
(nstrtime): Remove decl.
* src/diff.c: Revert most 2004-09-01 changes. Then:
Don't include <posixver.h>, <quotesys.h>, <setmode.h>.
Include <sh-quote.h>, <stat-time.h>, <timespec.h>.
All uses of quotesys replaced by sh-quote.
(main, compare_files):
Use freopen instead of setmode, since freopen is in POSIX.
(main): Don't complain about "diff -NUM'.
(main, set_mtime_to_now):
Adjust to stat-time.h macros when accessing nanoseconds.
* src/diff3.c: Include sh-quote.h rather than quotesys. All uses
changed.
* src/dir.c (dir_read): excluded_filename renamed to
excluded_file_name.
* src/io.c: Don't include <setmode.h>.
(sip, read_files): Remove binary file stuff, leaving a FIXME behind.
A DOS expert needs to look at this.
* src/diff.c: Include sh-quote.h rather than quotesys.h.
All uses changed.
* src/system.h: Include verify.h.
(verify): Remove. All uses changed to verify.h version.
Include <intprops.h>.
(TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove. Now uses
intprops.h versions.
(O_BINARY): New defns, taken from coreutils.
* src/util.c: Include sh-quote.h rather than quotesys.h.
All uses changed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
report_identical_files): Move into struct diffopt. All uses changed.
(exclude_options, compare_files, specify_style, check_stdout):
New arg OPT. All uses changed.
(GDIFF_MAIN): Remove. All uses removed.
(function_regexp_list, ignore_regexp_list): No longer static; now
locals in 'main'.
(main): Set opt.function_regexp, opt.ignore_regexp if using regexps;
all other code now tests these pointers rather than inspecting fastmap
internals.
New local OPT to hold former statics; initialize it.
(init_regexp_list): New function, used by main.
(summarize_regexp_list): Now returns struct re_pattern_buffer *, and
assumes reglist->regexps is not NULL. All uses changed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(option_help_msgid): Mention exit status.
(main): Adjust to latest gnulib c_stack_action calling conventions.
Adjust to latest version_etc calling conventions.
Include <exit.h>.
(binary): Define to true if not declared.
(longopts): Set tabsize flag to 1.
(main): Don't output nanoseconds if platform lacks them.
Don't treat files as binary if !binary.
(set_mtime_to_now): Use 0, not NULL.
(compare_files): Mark files as nonexistent if it looks like
'patch' created inaccessible regular empty files to denote
nonexistent backups. Don't compare such files.
Clear st_* members of status of nonexistent file.
Remove now-unnecessary tests.
|
|
|
|
|
| |
(copyright_notice): Remove.
(main): Use version_etc to print version.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Include paths.h.
(copyright_notice): Renamed from copyright_string.
Now a msgid, so that copyright symbol can be translated.
All uses changed.
Include posixver.h.
(TABSIZE_OPTION): New constant.
(main): Allow widths up to SIZE_MAX.
(filetype): Move to lib/file-type.c and rename to file_type.
All uses changed.
(longopts, main, usage): New option --tabsize=COLUMNS.
|
|
|
|
| |
Mitsuru Chinen.
|
| |
|
|
|
|
| |
--inhibit-hunk-merge, -H.
|
| |
|
|
|
|
| |
(longopts): Revert to prevision version.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Do not include signal.h.
(specify_style, specify_value): Bring these routines back, as POSIX
requires that the order of options not matter.
(shortopts): New constant.
(group_format_option, line_format_option): New constants.
(LONG_OPTION, GROUP_FORMAT_OPTION, LINE_FORMAT_OPTION): New macros.
(longopts): Use them.
(main): 0 -> EXIT_SUCCESS, 1 -> EXIT_FAILURE, 2 -> EXIT_TROUBLE.
Ensure that order of options does not matter.
Check for stack overflow.
If contexts overflow, substitute LIN_MAX, as that's good enough.
If multiple contexts are specified, use their maximum.
-c is equivalent to -C 3 now, instead of having an implicit context;
likewise for -u and -U 3.
Use specify_style and specify_value.
(SIGCHLD): Do not define; now done in a header.
Use new style time stamp format for -u / -U.
Reject numeric-string options if operating in POSIX 1003.1-2001 mode.
Avoid overflow problems with tab width.
Simplify from-file and to-file code.
(usage): Do not mention obsolete options.
(filetype): Do not mention whether a file is executable.
Add typed memory objects.
(compare_files): 0 -> EXIT_SUCCESS, 1 -> EXIT_FAILURE, 2 -> EXIT_TROUBLE.
|
|
|
|
|
| |
(usage): Reformat messages to ease translation.
(main): Remove unused variable.
|
|
|
|
|
|
|
|
| |
(main): Use 130 instead of DEFAULT_WIDTH, since it's not really
builder-settable. Do not prepend DIFF_OPTIONS.
(check-stdout): If fclose (stdout) fails, print errno info.
(option_help_msgid): Default context is 3, not 2.
(usage): Work even if ptrdiff_t is wider than int.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(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.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
int -> bool for booleans.
long -> off_t for line numbers.
Use angle-brackets when including getopt.h, fnmatch.h, quotesys.h.
Include error.h, exclude.h, freesoft.h, hard-locale.h, prepargs.h,
regex.h, signal.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
option spellings. All uses changed.
(binary): Renamed from binary_flag.
(new_file): Renamed from entire_new_file_flag.
(unidirectional_new_file): Renamed from unidirectional_new_file_flag.
(report_identical_files): Renamed from print_file_same_flag.
(numeric_arg): Remove.
(exclude, exclude_alloc, exclude_count, excluded_filename, add_exclude,
add_exclude_file):
Remove; now done by exclude.h.
(BINARY_OPTION, FROM_FILE_OPTION, HELP_OPTION, HORIZON_LINES_OPTION,
IGNORE_FILE_NAME_CASE_OPTION, INHIBIT_HUNK_MERGE_OPTION,
LEFT_COLUMN_OPTION, LINE_FORMAT_OPTION, NORMAL_OPTION,
SDIFF_MERGE_ASSIST_OPTION, STRIP_TRAILING_CR_OPTION,
SUPPRESS_COMMON_LINES_OPTION, TO_FILE_OPTION,
UNCHANGED_LINE_FORMAT_OPTION, OLD_LINE_FORMAT_OPTION,
NEW_LINE_FORMAT_OPTION, UNCHANGED_GROUP_FORMAT_OPTION,
OLD_GROUP_FORMAT_OPTION, NEW_GROUP_FORMAT_OPTION,
CHANGED_GROUP_FORMAT_OPTION): New constants.
(longopts, main): Use them.
(longopts, main, option_help_msgid): Add -E, --from-file, --to-file.
(main): Invoke bindtextdomain and textdomain after setlocale.
Use grep syntax, not Emacs, for regular expressions.
Use exclude.h, not our own functions.
Use ISO 8601 time format in hard locales.
Prepend DIFF_OPTIONS.
Don't update ignore_some_changes.
Use strtoumax instead of numeric_arg.
Use specify_value when appropriate.
error -> try_help when appropriate.
-p now means ^[[:alpha:]$_], not ^[_a-zA-Z$].
Ignore --inhibit-hunk-merge.
Prefer changed group formats to unchanged ones.
Remove now-unnecessary casts.
Set files_can_be_treated_as_binary.
(specify_value): Renamed from specify_format. All uses changed.
(specify_style): Default is now unspecified, not normal. All uses changed.
(set_mtime_to_now): New function.
(compare_files): Use it. Use memset, not bzero.
Set stdin mtime to current time even when stdin is not a regular file.
Check for same file attributes, as well as for same file.
Use files_can_be_treated_as_binary.
"write failed" -> "standard output on output failure.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(quotesys.h): Include.
(ck_atoi): Remove.
(function_regexp_list, ignore_regexp_list): Now static.
(binary_flag): Renamed from binary_I_O.
(entire_new_file_flag, unidirectional_new_file_flag, print_file_same_flag):
Now static.
(numeric_arg): Renamed from ck_atoi.
New argument specifying the argument type.
(longopts, main): Don't assume ASCII.
(longopts): Remove old aliases --file-label, --entire-new-file, --ascii,
--print.
(main): Check for -1, not EOF, when calling getopt_long.
Use numeric_arg to report errors.
Report error if -l specified but pagination is not supported.
Report error if -S is specified twice with conflicting values.
Have --version conform to the new GNU standards.
Add new --from-file, --to-file, --inhibit-hun,-merge options.
Make the horizon at least as large as the context.
Add casts to pacify gcc -Wall.
(try_help): Add operand arg.
(option_help_msgid): Doc fix to match above.
(usage): Indent option_help_msgid.
(compare_files): Now takes struct comparison
instead of two directory names and a depth.
(NONEXISTENT, UNOPENED, ERRNO_ENCODE, ERRNO_DECODE):
New macros.
(DIR_P): New macro.
Report error if fflush does.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(quotearg.h): Include.
(ck_atoi): Remove.
(function_regexp_list, ignore_regexp_list): Now static.
(binary_flag): Renamed from binary_I_O.
(entire_new_file_flag, unidirectional_new_file_flag, print_file_same_flag):
Now static.
(numeric_arg): Renamed from ck_atoi.
New argument specifying the argument type.
(longopts, main): Don't assume ASCII.
(longopts): Remove old aliases --file-label, --entire-new-file, --ascii,
--print.
(main): Check for -1, not EOF, when calling getopt_long.
Use numeric_arg to report errors.
Report error if -l specified but pagination is not supported.
Report error if -S is specified twice with conflicting values.
Have --version conform to the new GNU standards.
Add new --from-file, --to-file, --inhibit-hun,-merge options.
Make the horizon at least as large as the context.
Add casts to pacify gcc -Wall.
(try_help): Add operand arg.
(option_help_msgid): Doc fix to match above.
(usage): Indent option_help_msgid.
(compare_files): Now takes struct comparison
instead of two directory names and a depth.
(NONEXISTENT, UNOPENED, ERRNO_ENCODE, ERRNO_DECODE):
New macros.
(DIR_P): New macro.
Report error if fflush does.
|
|
|
|
|
|
|
| |
-D FOO now outputs `/* ! FOO */ instead of `/* not FOO */'.
(option_help_msgid): New constant.
(usage): Use it, so message is translated one option at a time.
(compare_files): For label, use file_label if set.
|
|
|
|
|
|
|
| |
(add_regexp): Build one big regexp instead of a list of regexps.
(summarize_regexp_list): New function.
(regexp_list): Redesigned struct; moved here from diff.h.
(function_regexp_list, ignore_regexp_list): Likewise, for vars.
|
|
|
|
| |
(add_regexp): Free storage on failure. Allocate storage all at one go.
|