| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Run "make update-copyright".
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* tests/binary: Reverse arguments to compare to avoid failure of
new syntax-check rule.
* configure.ac: Use -Wno-format-nonliteral.
Mark functions as pure of const, per recommendations enabled by
new gcc -W options. Use _GL_ATTRIBUTE_PURE and _GL_ATTRIBUTE_CONST.
* lib/cmpbuf.h (buffer_lcm, block_compare):
Apply pure and/or const attributes.
* src/cmp.c (block_compare): Likewise.
* src/context.c (find_hunk): Likewise.
* src/diff.h (lines_differ): Likewise.
* src/diff3.c (skipwhite): Likewise.
* src/dir.c (dir_loop): Likewise.
* src/util.c (find_change, find_reverse_change): Likewise.
(translate_line_number): Likewise.
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
| |
Run "make update-copyright", so "make syntax-check" works in 2011.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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'.
|
|
|
|
|
|
| |
it mishandled 'cmp A B >/dev/null' when A is shorter than B and
differs before A's end-of-file, by outputting a bogus EOF message.
Also, it was inefficient if A and B were large.
|
|
|
|
|
| |
For example, "cmp <(echo b) <(echo a) > /dev/null" incorrectly
succeeded. Problem reported by Jim Meyering.
|
|
|
|
|
|
|
|
|
| |
(IF_LINT): New macro, to pacify GCC.
* src/analyze.c (diag, compareseq): Use IF_LINT.
* src/cmp.c (cmp): Likewise.
* src/diff3.c (process_diff): Likewise. Also, prefer NULL to 0.
* src/ifdef.c (do_printf_spec, scan_char_literal): Likewise.
* src/sdiff.c (edit): Likewise.
|
| |
|
| |
|
|
|
|
|
| |
(main): Use it to avoid bug when the "EOF on foo" message is
generated and stdout is /dev/null.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(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.
|
|
|
|
|
|
|
|
| |
(specify_comparison_type): Don't report an error if the comparison
type has already been specified the same way as this one.
(usage): Mention exit status.
(main): Adjust to latest gnulib c_stack_action calling conventions.
(main): Adjust to latest version_etc calling conventions.
|
|
|
|
|
|
| |
(copyright_notice): Remove.
(main): Use version_etc to print version.
(version_string): Remove decl.
|
|
|
|
|
|
|
| |
Include paths.h.
(copyright_notice): Renamed from copyright_string.
Now a msgid, so that copyright symbol can be translated.
All uses changed.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
(check_stdout): "indices and codes" -> "byte numbers and values"
(main): Use specify_comparison_type to detect option clashes.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
(hard_locale_LC_MESSAGES): Depend on ENABLE_NLS.
(try_help, check_stdout, main, cmp): 2 -> EXIT_TROUBLE.
(main): Check for stack overflow.
0 -> EXIT_SUCCESS.
1 -> EXIT_FAILURE.
(cmp): Likewise.
Accommodate ancient AIX hosts that set errno to
EINTR after uncaught SIGCONT.
|
|
|
|
|
|
| |
(bytes, parse_ignore_initial, cmp): Use UINTMAX_MAX
instead of (uintmax_t) -1, to avoid warnings on some compilers.
(usage): Reformat messages to ease translation.
|
|
|
|
|
|
| |
(check_stdout): Don't assume that the translations of "write failed"
and of "standard output" lack '%'.
(main): Check stdout after printing version.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(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".
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
int -> bool for booleans.
long -> off_t for line numbers.
Use angle-brackets when including cmpbuf.h, getopt.h.
Include error.h, freesoft.h, inttostr.h, xalloc.h.
(copyright_string): Use only most recent year.
(authorship_msgid): Wrap in N_().
(buffer): Now word*, not char*. All uses changed.
(word): Remove macro; now in system.h.
(long_options, option_help_msgid, main): -c --print-chars -> -b --print-bytes
(check_stdout): "write failed" -> "standard output"
(option_help_msgid): Wrap in N_().
(main): Invoke bindtextdomain and textdomain after setlocale.
Use strtoumax instead of doing the work ourselves.
Check for same_file_attributes as well as same_file.
(cmp): Use ssize_t for read returns, not size_t.
Do not assume that size_t is not narrower than int.
Do not assume that line numbers fit in 'long'.
(block_compare_and_count, block_compare):
Compiler now checks that buffers are word-aligned.
(block_compare_and_count): Count sizes with size_t, not long.
(sprintc): byte arg is unsigned char, not unsigned.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(free_software_msgid): New decl.
(error): Now has printf attribute.
(try_help): Likewise.
(long_options): Don't assume ASCII.
(try_help): Now accepts operand arg.
(main): Check for -1, not EOF, when calling getopt_long.
Report --ignore-initial value when complaining about it.
Output copyright and free software info with -v.
Don't assume ASCII.
Report last operand when one is missing.
Report text of extra operand.
Move block_read into cmpbuf.c.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(free_software_msgid): New decl.
(error): Now has printf attribute.
(try_help): Likewise.
(long_options): Don't assume ASCII.
(try_help): Now accepts operand arg.
(main): Check for -1, not EOF, when calling getopt_long.
Report --ignore-initial value when complaining about it.
Output copyright and free software info with -v.
Don't assume ASCII.
Report last operand when one is missing.
Report text of extra operand.
Move block_read into cmpbuf.c.
|
|
|
|
|
|
|
| |
(option_help_msgid): New constant.
(usage): Use it, so message is translated one option at a time.
(sprintc): Renamed from `printc'. Now outputs to a buffer instead of stdout.
(cmp): Use new sprintc semantics.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
(main): Use setmode, not open(..., O_BINARY); this hits stdin too.
Use NULL_DEVICE instead of "/dev/null".
(cmp): Use %lu instead of %ld when it is more likely to give correct output.
|
| |
|
| |
|
|
|
|
| |
(usage): Just print usage; let caller worry about exiting.
|