summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* build: rely on gnulib's progname moduleJim Meyering2009-11-115-19/+8
| | | | | | | | | | | | * 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.
* build: rely on gnulib's mbrtowc moduleJim Meyering2009-11-111-7/+0
| | | | | | | * bootstrap.conf (gnulib_modules): Add mbrtowc. * src/side.c [!HAVE_MBRTOWC]: Remove now-useless code, since gnulib guarantees working <wchar.h> and mbrtowc. * cfg.mk (local-checks-to-skip): Remove sc_prohibit_HAVE_MBRTOWC.
* maint/sc: enable check for unmarked diagnosticsJim Meyering2009-11-111-1/+1
| | | | | * cfg.mk (local-checks-to-skip): Remove sc_unmarked_diagnostics. * src/dir.c (diff_dirs): Mark a diagnostic for translation.
* maint/sc: use STREQ, not strcmp(a,b) == 0Jim Meyering2009-11-115-8/+10
| | | | | | | | | | | | | 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.
* maint/sc: enforce "file system" spellingJim Meyering2009-11-111-4/+4
| | | | | | * src/system.h: Spell it as two words, not one. * ms/config.sed: Likewise. * cfg.mk (local-checks-to-skip): Remove sc_file_system.
* maint/sc: remove useless if-before-free testsJim Meyering2009-11-112-8/+4
| | | | | | * 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.
* * src/side.c [!HAVE_MBRTOWC]: Supply defns for mbstate_t and mbrtowc.Paul Eggert2009-11-111-0/+7
| | | | Problem reported by Bruno Haible.
* * src/side.c (print_half_line): Don't convert to unsigned charPaul Eggert2009-11-111-1/+1
| | | | unnecessarily.
* Don't mishandle multibyte characters in side-by-side format.Paul Eggert2009-11-111-6/+45
| | | | | | | | | | | Problem reported by Erik Karlsson in <http://lists.gnu.org/archive/html/bug-gnu-utils/2008-01/msg00030.html>. * bootstrap.conf (gnulib_modules): Add wcwidth. * src/side.c: Include <wchar.h>. (print_half_line): Compute number of bytes and print widths of multibyte characters. Inspired by an alternative solution from Bruno Haible in <http://lists.gnu.org/archive/html/bug-gnu-utils/2008-01/msg00032.html>.
* * NEWS: New diff option --suppress-blank-empty (no longer -u default).Paul Eggert2009-11-114-9/+35
| | | | | | | | | | | | * 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.
* Break out diffseq.h into a separate file, so that gettext can usePaul Eggert2009-11-111-343/+25
| | | | | | | | | | | this code. Idea from Bruno Haible. * bootstrap.conf (gnulib_modules): Add diffseq. * src/analyze.c (xvec, yvec, fdiag, bdiag, too_expensive, SNAKE_LIMIT): (struct partition, diag, compareseq): Remove; now in diffseq.h. (ELEMENT, EQUAL, OFFSET, EXTRA_CONTEXT_FIELDS, NOTE_DELETE, NOTE_INSERT): (USE_HEURISTIC): New macros. Include "diffseq.h". (diff_2_files): Rewrite to use new diffseq.h interface.
* * src/diff.c (compare_files): Use last_component rather than base_name,Paul Eggert2009-11-113-7/+9
| | | | | | adjusting to gnulib API change. This avoids a memory leak. * src/sdiff.c (expand_name): Likewise. * src/util.c (dir_file_pathname): Likewise.
* * COPYING: New file.Paul Eggert2007-07-1914-111/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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/ifdef.c: Fix typo: "GNU DIFF General Public License" should bePaul Eggert2007-07-192-4/+4
| | | | | "GNU General Public License". Reported by Erich Guenther. * src/side.c: Likewise.
* (print_context_label): Use TYPE_IS_INTEGER macro rather than rollingPaul Eggert2007-06-181-1/+1
| | | | it ourselves.
* * src/context.c (print_context_label): Don't assume that time_tPaul Eggert2007-06-181-3/+17
| | | | | | fits in long int, since it doesn't in FreeBSD/arm. Problem reported by Xin Li in <http://lists.gnu.org/archive/html/bug-gnu-utils/2007-06/msg00091.html>.
* * NEWS: Mention new sdiff aliases 1 and 2 for l and r.Paul Eggert2007-06-061-11/+12
| | | | | | * doc/diff.texi (Merge Commands): Likewise. * src/sdiff.c (give_help): Give help for them. (edit): Support them.
* * bootstrap: Sync from gnulib.Paul Eggert2007-04-044-8/+4
| | | | | | | | | | * 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'.
* * src/analyze.c (build_reverse_script): Fix typo in comment.Paul Eggert2006-11-151-1/+1
| | | | Problem and fix reported by Daniel Hipschman.
* * src/sdiff.c (sigprocmask): Don't dump core if O is null.Paul Eggert2006-11-141-1/+1
|
* Don't assume SIGPIPE exists, and that sigblock and sigsetmaskPaul Eggert2006-11-141-4/+10
| | | | | | | | | | | exist if sigprocmask does not. Problem reported by Paul Edwards for MVS 3.8. * configure.ac (sigblock): Check whether this function is available, if sigprocmask is not. * src/sdiff.c (sigs): Omit SIGPIPE if it's not defined. Put SIGINT last; all uses changed. (handler_index_of_SIGPIPE): Omit if SIGPIPE is not defined. (sigblock, sigsetmask) [!HAVE_SIGBLOCK]: New macros.
* * src/sdiff.c (sigprocmask) [! HAVE_SIGPROCMASK]: Cast 2nd arg toPaul Eggert2006-11-051-1/+3
| | | | | sigset_t *, since it might be a literal 0. Problem reported by Paul Edwards for MVS 3.8.
* Modernize bootstrap procedure to match current gnulib.Paul Eggert2006-09-053-113/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bootstrap: Sync with coreutils bootstrap, except check that the directory build-aux exists before trying to copy to it. * bootstrap.conf: New file. (gnulib_modules): Add config-h, dup2, extensions, fcntl, fdl, stat-macros, unistd. * configure.ac: Invoke gl_EARLY and gl_INIT rather than GNULIB_AUTOCONF_SNIPPET. (AC_CONFIG_HEADER): Rename config.h to lib/config.h. (AC_CHECK_HEADERS_ONCE): Don't check for fcntl.h, locale.h, sys/file.h, unistd.h. We now use the fcntl and unistd modules, and locale.h can be assumed for any C89 compiler. (DIFFUTILS_PREREQUISITES): Remove. No longer needed now that we use the stdint module. (AC_CHECK_FUNCS_ONCE): Remove dup2, which is no longer needed now that we use the dup2 module. (AM_GNU_GETTEXT): Use need-formatstring-macros, and ... (AM_GNU_GETTEXT_VERSION): specify version 0.15 instead of 0.14.5, to be consistent with coreutils. * lib/Makefile.am (noinst_LIBRARIES): (lib_SOURCES, libdiffutils_a_LIBADD): (libdiffutils_a_DEPENDENCIES, BUILT_SOURCES, EXTRA_DIST): (MOSTLYCLEANFILES): Remove; now computed automatically. (noinst_HEADERS, libdiffutils_a_SOURCES): Just append our special files now. * lib/cmpbuf.c: Include config.h unconditionally, since we no longer define HAVE_CONFIG_H. * lib/prepargs.c: Likewise. * src/Makefile.am (LDADD): Use $(LIBINTL), not @LIBINTL@. (diff_LDADD): Use $(LIB_CLOCK_GETTIME), not @LIB_CLOCK_GETTIME@. * src/dir.c (dir_read): Use _D_EXACT_NAMLEN, not NAMELEN. * src/system.h (volatile): Remove, since we assume C89 or better. Include stat-macros.h. (S_IRWXU, S_IRWXG, S_IRWXO, S_IRUSR, S_IWUSR): Remove, since we now use stat-macros.h. (SEEK_SET, SEEK_CUR): Remove, since we assume C89 or better. Include unistd.h unconditionally, since we use unistd. Likewise for fcntl.h. (dup2): Remove, since we now use dup2. (O_RDONLY, O_RWDR, O_BINARY): Remove, since we now use fcntl. Include dirent.h unconditionally. (NAMLEN): Remove, replacing with.... (_D_EXACT_NAMLEN): New macro. Include inttypes.h unconditionally. (PTRDIFF_MAX, SIZE_MAX, UINTMAX_MAX, strtoumax): Remove, since we now use inttypes. Include locale.h unconditionally. (setlocale): Remove, since we now assume locale.h.
* * doc/diff.texi (Detailed Unified): Don't output trailing whitePaul Eggert2006-09-051-2/+4
| | | | | space unless the input data has it. * src/context.c (pr_unidiff_hunk): Likewise.
* * src/context.c (print_context_function): Do not printPaul Eggert2006-09-051-0/+2
| | | | trailing white space in a context header.
* * src/cmp.c (cmp): The previous fix wasn't quite right either, asPaul Eggert2006-05-091-6/+7
| | | | | | 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.
* * src/cmp.c (cmp): Fix bug introduced in 2006-03-09 change.Paul Eggert2006-05-081-2/+2
| | | | | For example, "cmp <(echo b) <(echo a) > /dev/null" incorrectly succeeded. Problem reported by Jim Meyering.
* * src/context.c (pr_context_hunk, pr_unidiff_hunk):Paul Eggert2006-05-074-34/+33
| | | | | | | | | | | | | Prefer fputs or fputc to fprintf, since it's a tad more efficient with unlocked-IO on glibc. Long ago we avoided fputs to work around an ancient SunOS bug, but that's no longer relevant. * src/diff3.c (output_diff3, dotlines, undotlines): (output_diff3_edscript, output_diff3_merge): Likewise. This also avoids a gcc -Wformat-security warning reported by Jim Meyering. * src/ed.c (print_ed_hunk, print_forward_ed_hunk, print_rcs_hunk): Likewise. * src/normal.c (print_normal_hunk): Likewise.
* (find_identical_ends): Fix huge performance bug that IPaul Eggert2006-05-071-2/+3
| | | | | | | | introduced in the 2001-11-25 change: the code to remove the identical suffix also looked at the trailing sentinel, which meant the common suffix length was always incorrectly calculated to be zero. Problem and fix reported by Daniel Hipschman. Instead of his fix, revert to the (nearly-equivalent) pre-2001 code.
* * src/system.h (PARAMS, PROTOTYPES): Remove; no longer needed.Paul Eggert2006-03-136-27/+27
| | | | | | | | | (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.
* Update code comment to match previous patch.Paul Eggert2006-03-091-1/+2
|
* (main): Avoid an unnecessary system call introduced in previous patch.Paul Eggert2006-03-091-6/+1
|
* * src/cmp.c (type_no_stdout): New constant.Paul Eggert2006-03-091-2/+11
| | | | | (main): Use it to avoid bug when the "EOF on foo" message is generated and stdout is /dev/null.
* Update FSF address.Paul Eggert2006-01-0514-15/+15
|
* * src/cmp.c: Don't include <setmode.h>.Paul Eggert2006-01-059-466/+404
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (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.
* (recursive, new_file, unidirectional_new_file,Paul Eggert2004-09-011-273/+271
| | | | | | | | | | | | | | | | 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.
* (find_function_last_search): Move into struct diffopt.Paul Eggert2004-09-011-91/+98
| | | | | | | | | All uses changed. (pr_context_label, pr_context_header, print_context_script, find_function, find_hunk, mark_ignorable, pr_context_hunk, pr_unidiff_hunk): New arg OPT. All uses changed. (print_context_number_range, print_unidiff_number_range): New arg OUT. All uses changed.
* (print_ed_hunk): Optimize the case where an insert'sPaul Eggert2004-07-211-5/+15
| | | | last line is a single-dot line.
* Do not include regex.h, as diff.h does this now.Paul Eggert2004-04-121-52/+49
| | | | | | (lines_differ): Don't convert char * to unsigned char *; just leave pointers as char *. This lessens the number of potentially-dangerous casts.
* (S_IRWXU, S_IRWXG, S_IRWXO): Define if not defined.Paul Eggert2004-04-121-70/+21
| | | | | | | | | | | | | | | (S_IXUSR, S_IXGRP, S_IXOTH): Remove. Include <time.h> unconditionally, since we can assume C89 now. Likewise for <stdlib.h>, <string.h>. (getenv, EXIT_SUCCESS, EXIT_FAILURE, SSIZE_MAX, strchr, strrchr, memcmp, memcpy): Remove decl; no longer needed. (strcasecoll, strcasecmp): Define if not built in. (CTYPE_DOMAIN, ISPRINT, ISSPACE, TOLOWER, _tolower, errno): Remove; we now assume C89 or better. All uses changed. Include <stdbool.h> unconditionally now, since gnulib supports it if the C compiler doesn't. All boolean uses of 0 and 1 now changed to false and true. (lin_is_printable_as_long_int): Renamed from lin_is_printable_as_long.
* minor cleanups for bool, etcPaul Eggert2004-04-121-8/+8
|
* (usage): Mention exit status.Paul Eggert2004-04-121-41/+56
| | | | | | | | | | | (main): Adjust to latest gnulib c_stack_action calling conventions. Adjust to latest version_etc calling conventions. Include <unlocked-io.h>, <exit.h>. (check_child_status): Renamed from ck_editor_status, and accept a new arg MAX_OK_STATUS. All callers changed. Handle status 126/127 as per POSIX. (edit): Likewise. (main): Likewise. Fix getopt typo: -E wasn't supported.
* Do not include regex.h, as diff.h does this now.Paul Eggert2004-04-121-32/+31
| | | | | | (find_and_hash_each_line): Don't convert char * to unsigned char *; just leave pointers as char *. This lessens the number of potentially-dangerous casts.
* (next_line): Remove; replace with...Paul Eggert2004-04-121-13/+19
| | | | | | (next_line0, next_line1): New vars. (print_ifdef_script, print_ifdef_hunk): Use them to fix line-number computation bug.
* int -> long intPaul Eggert2004-04-121-3/+3
|
* Include <strcase.h>.Paul Eggert2004-04-121-26/+25
| | | | | | | | (failed_locale_specific_sorting): Renamed from failed_strcoll. All uses changed. (compare_names): Don't invoke strcasecmp first thing when ignore_file_name_case; if locale_specific_sorting, we should just use that.
* (usage): Mention exit status.Paul Eggert2004-04-121-59/+92
| | | | | | | | | | | | (main): Adjust to latest gnulib c_stack_action calling conventions. Adjust to latest version_etc calling conventions. Include unlocked-io.h. (strip_trailing_cr): New var. (STRIP_TRAILING_CR_OPTION): New enum. (longopts, main, option_help_msgid, read_diff): Add --strip-trailing-cr support. (read_diff): Exit with status 126 (not 127) if errno != ENOENT after failed execvp in child. Report this in parent.
* Include regex.h, unlocked-io.h.Paul Eggert2004-04-121-4/+6
| | | | | | (struct file_data.changed): Now char *, not bool *, to save space on hosts where bool takes more space than char. All uses changed.
* Do not include regex.h, as diff.h does this now.Paul Eggert2004-04-121-64/+78
| | | | | | | | | | | | | | | | | (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.
* Do not include regex.h, as diff.h does this now.Paul Eggert2004-04-122-12/+11
|