690 Commits

Author SHA1 Message Date
Paul Eggert
2daf7bfa36 Modernize bootstrap procedure to match current gnulib.
* 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.
2006-09-05 22:57:29 +00:00
Paul Eggert
a204b37fb2 * doc/diff.texi (Detailed Unified): Don't output trailing white
space unless the input data has it.
* src/context.c (pr_unidiff_hunk): Likewise.
2006-09-05 22:57:09 +00:00
Paul Eggert
19397f6b83 * src/context.c (print_context_function): Do not print
trailing white space in a context header.
2006-09-05 14:04:57 +00:00
Paul Eggert
32625c5025 (cmp Options): -l also outputs the EOF message. 2006-07-26 06:20:59 +00:00
Paul Eggert
67d3afe06a * src/cmp.c (cmp): The previous fix wasn't quite right either, as
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.
2006-05-09 22:57:20 +00:00
Paul Eggert
f0098c7f4f Use Jim's wording in ChangeLog entry, mostly. 2006-05-08 07:21:34 +00:00
Paul Eggert
f74bf83444 Correct authorship of previous patch. 2006-05-08 07:17:54 +00:00
Paul Eggert
69aaf732ab * src/cmp.c (cmp): Fix bug introduced in 2006-03-09 change.
For example, "cmp <(echo b) <(echo a) > /dev/null" incorrectly
succeeded.  Problem reported by Jim Meyering.
2006-05-08 01:41:04 +00:00
Paul Eggert
96e1fbe4c7 * src/context.c (pr_context_hunk, pr_unidiff_hunk):
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.
2006-05-07 08:16:19 +00:00
Paul Eggert
e084212316 find_identical_ends and doc/diff.texi fixes 2006-05-07 04:07:58 +00:00
Paul Eggert
58d0483b62 (find_identical_ends): Fix huge performance bug that I
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.
2006-05-07 04:07:41 +00:00
Paul Eggert
bcfeb9cb38 Switch from GFDL 1.1 to 1.2. 2006-05-07 04:06:50 +00:00
Paul Eggert
4c0c7c59d6 * src/system.h (PARAMS, PROTOTYPES): Remove; no longer needed.
(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.
2006-03-13 19:11:17 +00:00
Paul Eggert
a3dd61b474 Update code comment to match previous patch. 2006-03-09 20:57:25 +00:00
Paul Eggert
dab9c7e59b (main): Avoid an unnecessary system call introduced in previous patch. 2006-03-09 20:54:39 +00:00
Paul Eggert
708ba31420 * src/cmp.c (type_no_stdout): New constant.
(main): Use it to avoid bug when the "EOF on foo" message is
generated and stdout is /dev/null.
2006-03-09 20:38:11 +00:00
Paul Eggert
57253a174c Handle gettext.m4 like glibc21.m4. Don't remove po/en.po. 2006-01-05 07:33:42 +00:00
Paul Eggert
f5c7610983 Update FSF address. 2006-01-05 07:23:55 +00:00
Paul Eggert
e781e2df7c Describe CVS access better, using the README-alpha from GNU tar. 2006-01-05 07:15:26 +00:00
Paul Eggert
91b8605708 * src/cmp.c: Don't include <setmode.h>.
(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.
2006-01-05 07:08:23 +00:00
Paul Eggert
174ab83965 (recursive, new_file, unidirectional_new_file,
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.
2004-09-01 15:06:09 +00:00
Paul Eggert
203069b84a (find_function_last_search): Move into struct diffopt.
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.
2004-09-01 14:50:42 +00:00
Paul Eggert
3b86367275 Add AC_C_INLINE. 2004-09-01 14:37:55 +00:00
Paul Eggert
0d349232b3 (print_ed_hunk): Optimize the case where an insert's
last line is a single-dot line.
2004-07-21 08:58:38 +00:00
Paul Eggert
61d0b7e9bd Initial revision 2004-07-21 08:58:12 +00:00
Paul Eggert
ce64bdaf0e Don't include <stdbool.h>, since setmode.h now does this.
Include setmode.h first, to catch interface errors.
Assume HAVE_SETMODE_DOS is defined.
2004-06-30 17:49:57 +00:00
Paul Eggert
4f8fa6adc3 Include stdbool.h. 2004-06-30 17:46:07 +00:00
Paul Eggert
316aba1727 Don't remove po/en.po. 2004-04-26 18:04:04 +00:00
Paul Eggert
9080cf8511 Don't generate a temporary file, as this runs afoul of "make distcheck"
which operates with read-only directories.
2004-04-13 22:39:49 +00:00
Paul Eggert
6a7b42e65a (EXTRA_DIST): Add bootstrap.
Remove config/config.rpath as it is deduced automatically these days.
2004-04-13 06:56:38 +00:00
Paul Eggert
4a1de90b3c Version 2.8.7. v2.8.7 2004-04-13 06:56:18 +00:00
Paul Eggert
a76094697e (AM_GNU_GETTEXT_VERSION): Add.
(XGETTEXT): Restore from pre-2004-04-12 version.  This fixes
a bug that lost many msgids in doc/diffutils.pot.
(AC_INIT): Version 2.8.7.
2004-04-13 06:55:43 +00:00
Paul Eggert
45cc4e0358 Initial revision 2004-04-13 06:47:34 +00:00
Paul Eggert
fefbcf76e6 (AC_CONFIG_COMMANDS): Remove. 2004-04-12 23:07:15 +00:00
Paul Eggert
74bdeeafed (EXTRA_DIST): Add setmode.h. 2004-04-12 20:45:50 +00:00
Paul Eggert
2e22505469 Use inttostr module, so we needn't worry about specifying it ourself. 2004-04-12 20:30:57 +00:00
Paul Eggert
a74be8d413 * configure.ac: Quote various arguments better.
(AC_CONFIG_MACRO_DIR): Add call, specifying "m4".
(AC_CONFIG_HEADER): Replaces AM_CONFIG_HEADER.
(gl_USE_SYSTEM_EXTENSIONS): Replaces AC_GNU_SOURCE.
(AC_ISC_POSIX): Remove; nobody ports to ancient ISC any more.
(AC_PROG_CPP, AC_PROG_INSTALL, AC_C_INLINE,
AC_HEADER_STDBOOL, AC_HEADER_STDC, AM_GNU_GETTEXT, XGETTEXT,
AC_HEADER_STAT, AC_FUNC_VPRINTF, jm_FUNC_GLIBC_UNLOCKED_IO,
jm_FUNC_GNU_STRFTIME, jm_FUNC_MALLOC, jm_FUNC_REALLOC,
jm_PREREQ_C_STACK, jm_PREREQ_ERROR, jm_PREREQ_HARD_LOCALE,
jm_PREREQ_QUOTEARG, jm_PREREQ_REGEX, AC_FUNC_FNMATCH_GNU, jm_AC_DOS):
Remove; not needed here, as our files don't use them directly
or we rely on gnulib modules.
(AC_C_CONST): Remove; we assume C89 now.
(AC_CHECK_HEADERS): Remove libintl.h, limits.h, stdlib.h, string.h,
time.h.
(AC_CHECK_TYPE): Remove ptrdiff_t, ssize_t.
(AC_CHECK_FUNCS): Remove diraccess, strchr, strerror, tmpnam).
(AC_REPLACE_FUNCS): Remove memchr, mkstemp, strcasecmp.
(GNULIB_AUTOCONF_SNIPPET): Add call.  This replaces much of
the above.
(AC_CONFIG_FILES): Remove lib/posix/Makefile.
v2.8.6
2004-04-12 07:44:35 +00:00
Paul Eggert
2ea441f7e2 Initial revision 2004-04-12 07:44:35 +00:00
Paul Eggert
b3f6204729 Move copyright notice to end. Defer to "configure
--help" for special "configure" options.  Suggest latest libiconv.	Update version numbers of Autoconf etc. to current.
2004-04-12 07:44:35 +00:00
Paul Eggert
477cd3074a Add news for 2.8.4, 2.8.6. 2004-04-12 07:44:35 +00:00
Paul Eggert
3f0830fef5 Do not include regex.h, as diff.h does this now.
(lines_differ): Don't convert char * to unsigned char *;
just leave pointers as char *.  This lessens the number of
potentially-dangerous casts.
2004-04-12 07:44:35 +00:00
Paul Eggert
43adfd44c5 (S_IRWXU, S_IRWXG, S_IRWXO): Define if not defined.
(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.
2004-04-12 07:44:35 +00:00
Paul Eggert
5af1582ab8 minor cleanups for bool, etc 2004-04-12 07:44:35 +00:00
Paul Eggert
c151c4194b (usage): Mention exit status.
(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.
2004-04-12 07:44:35 +00:00
Paul Eggert
4cdc5fbf2b Do not include regex.h, as diff.h does this now.
(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.
2004-04-12 07:44:35 +00:00
Paul Eggert
fbe4a6f698 (next_line): Remove; replace with...
(next_line0, next_line1): New vars.
(print_ifdef_script, print_ifdef_hunk):
Use them to fix line-number computation bug.
2004-04-12 07:44:35 +00:00
Paul Eggert
b4a6ac7a09 int -> long int 2004-04-12 07:44:35 +00:00
Paul Eggert
ede07ddb4d Include <strcase.h>.
(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.
2004-04-12 07:44:35 +00:00
Paul Eggert
d5b0491a31 (usage): Mention exit status.
(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.
2004-04-12 07:44:35 +00:00
Paul Eggert
70a8b49b0f Include regex.h, unlocked-io.h.
(struct file_data.changed): Now char *, not bool *, to save
space on hosts where bool takes more space than char.
All uses changed.
2004-04-12 07:44:35 +00:00