summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* maint: update copyright datesJim Meyering2023-01-013-3/+3
|
* maint: make update-copyrightJim Meyering2022-01-033-3/+3
|
* maint: refactor integer overflow checkingPaul Eggert2021-08-221-2/+1
| | | | | | | | | | | | | | Rely on more-modern Gnulib capabilities instead of doing integer overflow checking by hand, in some cases. * lib/cmpbuf.c (buffer_lcm): * src/io.c (slurp, find_identical_ends): Use INT_ADD_WRAPV and INT_MULTIPLY_WRAPV rather than checking overflow by hand. * src/diff3.c (process_diff): * src/dir.c (dir_read): * src/io.c (find_identical_ends, read_files): Use xnmalloc rather than checking overflow by hand. (read_files): Rely on xcalloc to do overflow checking.
* maint: remove prepargsPaul Eggert2021-08-223-96/+2
| | | | | | | | * lib/Makefile.am (noinst_HEADERS): Remove prepargs.h. (libdiffutils_a_SOURCES): Remove prepargs.c. * lib/prepargs.c, lib/prepargs.h: Remove. Hasn’t been needed for many years. * src/diff.c: Do not include prepargs.h.
* maint: update all copyright year number rangesJim Meyering2021-01-014-4/+4
| | | | | | | Run "make update-copyright" and then... * gnulib: Update to latest with copyright year adjusted. * tests/init.sh: Sync with gnulib to pick up copyright year. * bootstrap: Likewise.
* maint: update all copyright year number rangesJim Meyering2020-01-014-4/+4
| | | | | | | Run "make update-copyright" and then... * gnulib: Update to latest with copyright year adjusted. * tests/init.sh: Sync with gnulib to pick up copyright year. * bootstrap: Likewise.
* maint: convert all TABs to equivalent spaces in indentationJim Meyering2019-01-052-28/+28
| | | | | | | | | | | | | | | | | | | | | | | Using this file, cat > leading-blank.exempt <<\EOF (\.gitmodules|help2man|pre-commit)$ (?:^|\/)ChangeLog[^/]*$ (?:^|\/)(?:GNU)?[Mm]akefile[^/]*$ \.(?:am|mk)$ EOF run the following command to convert all non-conforming leading white space to be all spaces: git ls-files \ | pcregrep -vf leading-blank.exempt \ | xargs pcregrep -l '^ *\t' \ | xargs perl -MText::Tabs -ni -le \ '$m=/^( *\t[ \t]*)(.*)/; print $m ? expand($1) . $2 : $_' Since that changed old NEWS, I also ran "make update-NEWS-hash" to update the old_NEWS_hash value in cfg.mk.
* maint: update all copyright dates via "make update-copyright"Jim Meyering2019-01-014-4/+4
| | | | * gnulib: Also update submodule for its copyright updates.
* maint: update gnulib and copyright dates for 2018Jim Meyering2018-01-064-4/+4
| | | | | | * gnulib: Update to latest. * all files: Run "make update-copyright". * bootstrap: Update from gnulib.
* maint: update gnulib and copyright dates for 2017Jim Meyering2017-01-014-4/+4
| | | | | * gnulib: Update to latest. * all files: Run "make update-copyright".
* maint: update copyright year, bootstrap, init.shJim Meyering2016-01-014-5/+5
| | | | | | | | Run "make update-copyright" and then... * gnulib: Update to latest. * tests/init.sh: Update from gnulib. * bootstrap: Likewise.
* maint: update copyright year ranges to include 2015; update gnulibJim Meyering2015-01-014-5/+7
|
* maint: update all copyright year number rangesJim Meyering2013-01-044-4/+4
| | | | Run "make update-copyright".
* build: accommodate newer bootstrap from gnulibJim Meyering2012-01-121-0/+11
| | | | | | | | | * bootstrap.conf (gnulib_tool_option_extras): Add both --symlink and --makefile-name=gnulib.mk. Also remove now-obsolete $bt/ prefix. * bootstrap: Update from gnulib. * tests/init.sh: Update from gnulib. * lib/Makefile.am: Initialize numerous variables, so that generated code in gnulib.mk may use += to append to them.
* maint: update all copyright year number rangesJim Meyering2012-01-014-4/+4
| | | | Run "make update-copyright".
* build: update to latest gnulib and adaptJim Meyering2011-12-141-1/+1
| | | | | | | | | | | | | | | | | * 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.
* maint: update copyright year ranges to include 2011Jim Meyering2011-01-034-4/+4
| | | | Run "make update-copyright", so "make syntax-check" works in 2011.
* build: don't define macros that gnulib providesJim Meyering2010-05-091-15/+1
| | | | | | | | | * bootstrap.conf (gnulib_modules): Add signal, stdint. * lib/cmpbuf.c (SA_RESTART, SA_INTERRUPT): Remove definitions. (SIZE_MAX, PTRDIFF_MAX): Likewise. Include <stdint.h>. * src/system.h (WEXITSTATUS, WIFEXITED): Remove definitions. (SA_RESTART, SA_INTERRUPT): Likewise.
* maint: remove now-useless #if HAVE_HEADER_H guardsJim Meyering2010-04-301-8/+2
| | | | | | * src/system.h: Include <sys/wait.h> unconditionally, now that gnulib guarantees its presence. * lib/cmpbuf.c: Likewise for <unistd.h> and <inttypes.h>.
* build: do not override gnulib-provided AM_CFLAGS optionsJim Meyering2010-02-041-1/+1
| | | | | | | | | | | | | | 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.
* maint: update all FSF copyright year lists to include 2010Jim Meyering2010-01-014-5/+4
| | | | | | Use this command: git ls-files |grep -vE '^(\..*|COPYING|gnulib)$' |xargs \ env UPDATE_COPYRIGHT_USE_INTERVALS=1 build-aux/update-copyright
* build: enable warnings and -Werror.Jim Meyering2009-11-221-0/+2
| | | | | | | | * 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.
* maint: remove hard-coded macro definitions provided by intprops.hJim Meyering2009-11-201-17/+1
| | | | | * lib/cmpbuf.c: Include "intprops.h" rather than open-coding macros like TYPE_SIGNED and TYPE_MINIMUM.
* admin: update all copyright notices to include the year 2009Jim Meyering2009-11-114-5/+5
|
* maint/sc: remove cast of xmalloc return valueJim Meyering2009-11-111-1/+1
| | | | | * lib/prepargs.c (prepend_default_options): Remove useless cast. * cfg.mk (local-checks-to-skip): Remove sc_cast_of_x_alloc_return_value.
* remove many filesJim Meyering2009-11-1127-4848/+0
| | | | | Many are now obtained via bootstrap from gnulib. Others (ms/) were not being maintained.
* * COPYING: New file.Paul Eggert2007-07-194-30/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* Modernize bootstrap procedure to match current gnulib.Paul Eggert2006-09-053-21/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* Update FSF address.Paul Eggert2006-01-054-6/+6
|
* * src/cmp.c: Don't include <setmode.h>.Paul Eggert2006-01-055-656/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (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.
* Don't include <stdbool.h>, since setmode.h now does this.Paul Eggert2004-06-301-24/+10
| | | | | Include setmode.h first, to catch interface errors. Assume HAVE_SETMODE_DOS is defined.
* Include stdbool.h.Paul Eggert2004-06-301-0/+2
|
* (EXTRA_DIST): Add setmode.h.Paul Eggert2004-04-121-4/+2
|
* Use inttostr module, so we needn't worry about specifying it ourself.Paul Eggert2004-04-121-4/+3
|
* (SUBDIRS): Remove.Paul Eggert2004-04-121-18/+13
| | | | | | | | | (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.
* (set_binary_mode): Return true, not 1.Paul Eggert2004-04-121-2/+2
|
* (__attribute__): New macro.Paul Eggert2004-04-121-4/+9
| | | | | | (set_binary_mode): Define only if HAVE_SETMODE_DOS. Otherwise define a dummy static char, as C89 requires that we define something.
* (TYPE_SIGNED): Remove.Paul Eggert2002-09-221-5/+2
| | | | | (INT_STRLEN_BOUND): Don't use TYPE_SIGNED; that way, the macro works for either a type or an object.
* Snapshot before syncing with gnulib again.Paul Eggert2002-08-073-65/+35
|
* Switch to GPL.Paul Eggert2002-08-041-9/+8
|
* Include sys/time.h; from Volker Borchert.Paul Eggert2002-07-011-0/+6
|
* (segv_handler, c_stack_action) [! defined SA_SIGINFO]:Paul Eggert2002-06-221-2/+2
| | | | | Do not assume SA_SIGINFO behavior. Bug reported by Jim Meyering on NetBSD 1.5.2.
* (noinst_HEADERS): Remove freesoft.h.Paul Eggert2002-06-171-4/+4
| | | | | Add version-etc.h. (libdiffutils_a_SOURCES): Remove freesoft.c. Add version-etc.c.
* (version_etc): Remove package and version args.Paul Eggert2002-06-171-20/+2
| | | | (version_etc_copyright): Remove.
* (version_etc): Remove package and version args.Paul Eggert2002-06-171-29/+29
| | | | | | | | | (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.
* (WIDE_CHAR_SUPPORT): New macro. Use it uniformly instead ofPaul Eggert2002-06-122-4/+6
| | | | | (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H). It also depends on HAVE_BTOWC.
* Check for HAVE_SIGALTSTACK and HAVE_GETCONTEXT, too.Paul Eggert2002-06-111-4/+4
|
* Fix trailing white space.Paul Eggert2002-06-111-2/+2
|
* Include posixver.h.Paul Eggert2002-06-111-0/+2
|
* (struct patternlist.str): Size 1, not 0, as C89 requires this.Paul Eggert2002-06-111-4/+5
| | | | (NEW_PATTERN): Use offsetof, not sizeof, since str now has size 1.