87 Commits

Author SHA1 Message Date
Jim Meyering
7ea9bf381b maint: remove now-useless #if HAVE_HEADER_H guards
* src/system.h: Include <sys/wait.h> unconditionally,
now that gnulib guarantees its presence.
* lib/cmpbuf.c: Likewise for <unistd.h> and <inttypes.h>.
2010-04-30 18:56:14 +02:00
Jim Meyering
6bb6713807 build: do not override gnulib-provided AM_CFLAGS options
Avoid a warning from automake:
lib/Makefile.am:23: AM_CFLAGS multiply defined in condition TRUE ...
lib/gnulib.mk:30: ... `AM_CFLAGS' previously defined here
lib/Makefile.am:18:   `lib/gnulib.mk' included from here

* lib/Makefile.am (AM_CFLAGS): Append $(WARN_CFLAGS) and
$(WERROR_CFLAGS), i.e., use "+=", not "=".
This was introduced via 2009-12-17 commit e58efa5b
"build: enable warnings and -Werror.",
but fortunately is not a bug, because the definition
it would have overridden was always empty.
2010-02-04 20:03:03 +01:00
Jim Meyering
6a44886e24 maint: update all FSF copyright year lists to include 2010
Use this command:
git ls-files |grep -vE '^(\..*|COPYING|gnulib)$' |xargs \
env UPDATE_COPYRIGHT_USE_INTERVALS=1 build-aux/update-copyright
2010-01-01 16:18:27 +01:00
Jim Meyering
e58efa5bd2 build: enable warnings and -Werror.
* src/Makefile.am (AM_CFLAGS): Enable warnings and -Werror.
Set to this: $(WARN_CFLAGS) $(WERROR_CFLAGS)
* lib/Makefile.am (AM_CFLAGS): Similarly, but use this:
$(GNULIB_WARN_CFLAGS) $(WERROR_CFLAGS)
* configure.ac (GNULIB_WARN_CFLAGS): Don't turn off -Wuninitialized.
2009-11-22 17:16:25 +01:00
Jim Meyering
788645f184 maint: remove hard-coded macro definitions provided by intprops.h
* lib/cmpbuf.c: Include "intprops.h" rather than open-coding macros
like TYPE_SIGNED and TYPE_MINIMUM.
2009-11-20 10:20:54 +01:00
Jim Meyering
9bfafb33a6 admin: update all copyright notices to include the year 2009 2009-11-11 22:18:37 +01:00
Jim Meyering
f54288e8ee maint/sc: remove cast of xmalloc return value
* lib/prepargs.c (prepend_default_options): Remove useless cast.
* cfg.mk (local-checks-to-skip): Remove sc_cast_of_x_alloc_return_value.
2009-11-11 22:18:36 +01:00
Jim Meyering
7e7a52f33b remove many files
Many are now obtained via bootstrap from gnulib.
Others (ms/) were not being maintained.
2009-11-11 14:08:06 +01:00
Paul Eggert
43e4846f11 * COPYING: New file.
* 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.
2007-07-19 17:45:29 +00:00
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
f5c7610983 Update FSF address. 2006-01-05 07:23:55 +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
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
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
0ebd95fcbd (SUBDIRS): Remove.
(EXTRA_DIST, noinst_HEADERS): Remove most entries.
(libdiffutils_a_SOURCES): Now just lib_SOURCES.
(lib_SOURCES): New macro.
(DISTCLEANFILES, MOSTLYCLEANFILES): Set to empty now.
(gnulib.mk): Include: this does most of the work eliminated
by the above changes.
2004-04-12 07:44:35 +00:00
Paul Eggert
59500c52b2 (set_binary_mode): Return true, not 1. 2004-04-12 07:44:35 +00:00
Paul Eggert
6fc04adf12 (__attribute__): New macro.
(set_binary_mode): Define only if HAVE_SETMODE_DOS.
Otherwise define a dummy static char, as C89 requires
that we define something.
2004-04-12 07:44:35 +00:00
Paul Eggert
2b39a9397d (TYPE_SIGNED): Remove.
(INT_STRLEN_BOUND): Don't use TYPE_SIGNED; that way, the macro works
for either a type or an object.
2002-09-22 07:52:26 +00:00
Paul Eggert
f7a75bc37a Snapshot before syncing with gnulib again. 2002-08-07 09:10:36 +00:00
Paul Eggert
eb2b167bec Switch to GPL. 2002-08-04 11:15:53 +00:00
Paul Eggert
da7959d1e0 Include sys/time.h; from Volker Borchert. 2002-07-01 14:19:20 +00:00
Paul Eggert
f8d4015e36 (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
Do not assume SA_SIGINFO behavior.
Bug reported by Jim Meyering on NetBSD 1.5.2.
2002-06-22 13:29:17 +00:00
Paul Eggert
4ead5e1146 (noinst_HEADERS): Remove freesoft.h.
Add version-etc.h.
(libdiffutils_a_SOURCES): Remove freesoft.c.  Add version-etc.c.
2002-06-17 05:55:42 +00:00
Paul Eggert
b0ec6101bd (version_etc): Remove package and version args.
(version_etc_copyright): Remove.
2002-06-17 05:55:42 +00:00
Paul Eggert
cb95fdb5a3 (version_etc): Remove package and version args.
(version_etc_copyright): Remove.
Do not include unlocked-io.h; no longer needed.
Include gettext.h rather than libinto.h.
(_): Define unconditionally.
(version_etc): Adjust wording to match current GNU coding standards.
Translate "(C)" if possible.
2002-06-17 05:55:42 +00:00
Paul Eggert
edd7dd52ff (WIDE_CHAR_SUPPORT): New macro. Use it uniformly instead of
(defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).  It also depends
on HAVE_BTOWC.
2002-06-12 06:06:47 +00:00
Paul Eggert
d327549393 Check for HAVE_SIGALTSTACK and HAVE_GETCONTEXT, too. 2002-06-11 11:59:47 +00:00
Paul Eggert
65dbacedda Fix trailing white space. 2002-06-11 11:18:52 +00:00
Paul Eggert
aa5475b6b4 Include posixver.h. 2002-06-11 06:06:32 +00:00
Paul Eggert
bf641a9542 (struct patternlist.str): Size 1, not 0, as C89 requires this.
(NEW_PATTERN): Use offsetof, not sizeof, since str now has size 1.
2002-06-11 06:06:32 +00:00
Paul Eggert
bb9cc01d98 (EXTRA_DIST): Add fnmatch_loop.c.
(noinst_HEADERS): fnmatch_.h renamed from fnmatch.hin.
regex_.h renamed from regex.hin.
Add file-type.h.
(libdiffutils_a_SOURCES): Add file-type.c.
(DISTCLEANFILES): Remove fnmatch.hno, regex.hno.
2002-06-11 05:53:54 +00:00
Paul Eggert
9e4cdf9d2c (__const): Do not define to empty, as this breaks
Sun cc.  The code doesn't work with K&R anyway.
2002-06-11 05:53:54 +00:00
Paul Eggert
871e480cf6 (alloca, __builtin_expect): Define for non-GCC hosts.
<strings.h>: Include only if HAVE_STRINGS_H.
<stddef.h>: Include if we include stdlib.h.
Do not comment out all code if ! HAVE_FNMATCH_GNU.
(getenv): Do not declare if HAVE_DECL_GETENV.
(__strchrnul, __wcschrnul): Remove; not used.
(MEMPCPY): Use mempcpy if not _LIBC; use memcpy if neither _LIBC
nor HAVE_MEMPCPY.
(FOLD) [HANDLE_MULTIBYTE]: Do not pass wide char to ISUPPER.
(STRLEN, STRCAT, MEMPCPY) [HANDLE_MULTIBYTE && !defined _LIBC]:
Use wcslen rather than __wcslen, and likewise for wcscat, wmempcpy.
(MEMPCPY) [HANDLE_MULTIBYTE]: Use wmempcpy if not _LIBC; use wmemcpy
if neither _LIBC nor HAVE_WMEMPCPY.
2002-06-11 05:53:54 +00:00
Paul Eggert
a9a0f5a47b (siginfo_t, c_stack_die): Remove decl. 2002-06-11 05:53:54 +00:00
Paul Eggert
88ead75505 (__attribute__): New macro.
(EOVERFLOW): Define if not defined.(stack_t): Define to struct sigaltstack if not defined or declared.
Include <sys/resource.h>, <ucontext.h> if available.
Include <stdio.h> if DEBUG.
Do not include <inttypes.h> or <stdint.h>.
(c_stack_die): Remove info and context args.  All uses changed.
(segv_action): Likewise.
(alternate_signal_stack): Change uintmax_t to long, to ease porting.
(get_stack_location, min_address_from_argv, max_address_from_argv,
null_action): New functions.
(stack_base, stack_size): New vars.
(segv_handler): context arg may not be used.
Use global stack_base, stack_size if
! HAVE_XSI_STACK_OVERFLOW_HEURISTIC.
Add debug code.
Invoke die (rather than segv_action) to exit.
(c_stack_action): Accept new argv arg, and simpler handler arg.
All uses changed.  Move code into new functions above.
Allow null action.
[! (defined SA_ONSTACK && defined _SC_PAGESIZE)]: Assume all segvs
are stack overflows.
(main) [DEBUG]: Describe what output should be like.
2002-06-11 05:53:54 +00:00
Paul Eggert
a1fdcabe77 Initial revision 2002-05-10 11:20:06 +00:00
Paul Eggert
384ece6125 (__restrict_arr): Define for GCC 3.1 and up. 2002-04-08 18:56:39 +00:00
Paul Eggert
a758e82c03 (errno): Remove declaration; K&R C is obsolete.
Include limits.h.
(SIZE_MAX, SSIZE_MAX): Define if standard headers don't.
(MIN): New macro.
(block_read): Do not attempt to read more than SSIZE_MAX bytes, as the
resulting behavior is implementation-defined.  Work around bug in
Tru64 5.1, which can't read more than INT_MAX bytes at a time.
2002-04-05 20:37:31 +00:00
Paul Eggert
78899f4efb (c_stack_die) [!HAVE_SIGINFO_T]: Don't use info.
Bug reported by Eli Zaretskii.
2002-03-24 07:36:37 +00:00
Paul Eggert
0d3dcc25e7 (alloca): Remove.
Include stdlib.h if available, for malloc.
(hard_locale): Use malloc, not alloca.  Test for storage allocation failure.
2002-03-12 06:34:28 +00:00
Paul Eggert
dbea9821b7 (AUTOMAKE_OPTIONS): Remove. 2002-03-11 08:00:47 +00:00
Paul Eggert
1e15bf9664 Include <errno.h>
(ENOTSUP): Define if errno.h doesn't.
(SA_NODEFER, SA_ONSTACK, SA_RESETHAND, SA_SIGINFO, SIGSTKSZ, _SC_PAGESIZE,
ALTERNATE_STACK_SIZE, stack_t, sigaltstack): Remove; we now assume them
all when HAVE_XSI_STACK_OVERFLOW_HEURISTIC, so we don't need substitutes.
(<ucontext.h>): Include only if HAVE_XSI_STACK_OVERFLOW_HEURISTIC.
(alternate_signal_stack): Now of size SIGSTKSZ, not ALTERNATE_STACK_SIZE.
(segv_handler): Simplify, under the assumption that
HAVE_XSI_STACK_OVERFLOW_HEURISTIC is nonzero.
(c_stack_action): Likewise.
(exit_failure) [DEBUG]: Initialize to 0, not 1.
(recurse, main) [DEBUG]: Remove main args.
2002-03-11 08:00:47 +00:00
Paul Eggert
9f0eff52c2 Initial revision 2002-02-28 04:28:07 +00:00
Paul Eggert
8d9e3b29bf (buffer_lcm): New arg LCM_MAX. 2002-02-28 04:28:07 +00:00
Paul Eggert
47b633e3cf Include errno.h.
(errno): Declare if !STDC_HEADERS.
Include signal.h.
(SA_RESTART): Define if not already defined.
Include <inttypes.h>.
(PTRDIFF_MAX): Define if not already defined.
(TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Likewise.
(block_read): Accommodate ancient AIX hosts that set errno to EINTR
after uncaught SIGCONT.
(buffer_lcm): Return a reasonable size if the multiple is too large.
New arg LCM_MAX.  All callers changed.
2002-02-28 04:28:07 +00:00
Paul Eggert
a44befd50b (noinst_HEADERS): Add c-stack.h, exitfail.h.
(libdiffutils_a_SOURCES): Add c-stack.c, exitfail.c, quotesys.c.
(INCLUDES): Remove.
2002-02-28 04:28:07 +00:00
Paul Eggert
2e507ad1c0 Include exitfail.h.
(xalloc_exit_failure): Remove; subsumed by exit_failure.
All uses changed.
2002-02-28 04:28:07 +00:00
Paul Eggert
b89fe19666 (xalloc_exit_failure): Remove; subsumed by exit_failure. 2002-02-28 04:28:07 +00:00