summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* diff: avoid sprintf %sPaul Eggert2021-08-224-33/+63
| | | | | | | | | | | | sprintf fails if the result contains more than INT_MAX bytes, so rework the code to avoid usage of sprintf %s where the string might be longer than that. * bootstrap.conf (gnulib_modules): Remove xvasprintf. * src/diff.c (specify_style): * src/util.c (begin_output): Rewrite to avoid sprintf %s. * src/util.c: Do not include xvasprintf.h. (concat): Remove, as it uses sprintf %s. All uses rewritten.
* diff: use mempcpyPaul Eggert2021-08-224-23/+22
| | | | | | | | | * bootstrap.conf (gnulib_modules): Add mempcpy, stpcpy. * src/ifdef.c (do_printf_spec): * src/sdiff.c (expand_name, lf_snarf, temporary_file): * src/util.c (message5): Prefer mempcpy to memcpy plus manual size-updating. Prefer stpcpy to mempcpy plus manual size-spec.
* sdiff: fix unlikely memory leakPaul Eggert2021-08-221-5/+8
| | | | | * src/sdiff.c (temporary_file): Fix memory leak when mkstemp fails. Don’t assume temporary file name length fits in ‘int’.
* diff3: simplify process_diffPaul Eggert2021-08-221-10/+7
| | | | | | * src/diff3.c (process_diff): Remove LAST_BLOCK arg, since callers no longer needed it. All callers changed. This removes an unnecessary initialization of bptr to NULL.
* maint: modernize IF_LINT for GCC 11.2.1Paul Eggert2021-08-225-9/+6
| | | | | | | | | | | | | * src/cmp.c (cmp): * src/dir.c (find_dir_file_pathname): * src/sdiff.c (edit): Mention which GCC bug this IF_LINT works around. * src/diff3.c (process_diff): Always initialize to NULL, to avoid problems on mostly-theoretical hosts where accessing uninitialized variables traps. The next patch will have a better fix for this. * src/ifdef.c (do_printf_spec): No need for IF_LINT in GCC 11.2.1.
* maint: lint → GCC_LINTPaul Eggert2021-08-223-5/+6
| | | | | | | | ‘lint’ is for traditional lint and perhaps some other tools; ‘GCC_LINT’ is targeted more for what we do. Gnulib accepts either, but we might as well be more accurate. * configure.ac (GCC_LINT): Define this instead of ‘lint’. All uses changed.
* diff: remove printintPaul Eggert2021-08-229-78/+37
| | | | | * src/system.h (printint): Remove. All uses removed. This type was only for porting to pre-C89 hosts, and is no longer needed.
* diff: remove INT_MAX limit on -F/-p searchesPaul Eggert2021-08-221-2/+3
| | | | | * src/context.c (find_function): Don’t limit function-line searches to INT_MAX bytes, removing a FIXME.
* maint: .gitignore updatesPaul Eggert2021-08-221-62/+77
| | | | | | | | | | | | | | * .gitignore: Remove lib/unused-parameter.h. Add all of m4, since no files there need to be committed; this lets us remove m4/.gitignore and m4/gnulib-cache.m4. Add *.orig, *.patch, .Tpo, /*.diff, lib/*/ (which lets us remove /lib/sys/), lib/ctype.h, lib/errno.h, lib/float.h, lib/fnmatch.h, lib/getopt-cdefs.h, lib/getopt.h, lib/limits.h, lib/sigsegv.h, lib/stdalign.h, lib/stdarg.h, lib/stdbool.h, lib/stddef.h, lib/stdint.h, lib/stdopen.[ch], vc-dwim-log-*. Add slashes to autom4te.cache, build-aux. Remove redundant initial slashes from patterns that also have internal slashes. Remove plain ABOUT-NLS, since /ABOUT-NLS suffices. Sort using LC_ALL=C.
* maint: omit unused function if not debuggingPaul Eggert2021-08-221-0/+2
| | | | * src/util.c (debug_script): Compile only if DEBUG.
* maint: remove prepargsPaul Eggert2021-08-224-97/+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: zalloc → xzallocPaul Eggert2021-08-224-18/+5
| | | | | * src/util.c (zalloc): Remove. All uses replaced by xzalloc, which means the same thing.
* diff3: suppress -fanalyzer alarmsPaul Eggert2021-08-222-3/+17
| | | | | | | | * src/diff3.c: Add pragma to suppress -Wanalyzer-null-dereference alarms. * src/diff.h (find_dir_file_pathname): Add malloc-related attributes, to pacify gcc -Wsuggest-attribute=malloc.
* maint: remove January workaround for Gnulib issuePaul Eggert2021-08-221-4/+0
| | | | | * configure.ac: Don’t add -Wno-analyzer-null-argument, since the issue is now fixed in Gnulib.
* build: update gnulib submodule to latestPaul Eggert2021-08-221-0/+0
|
* maint: remove stray init.cfgPaul Eggert2021-08-011-68/+0
| | | | | | * init.cfg: Remove. I guess this file was a stray, since it was a copy of tests/init.cfg when it was checked in, and it hasn’t been maintained since.
* tests: port to valgrind 3.16.0 + GCC 11.2Paul Eggert2021-08-011-1/+7
| | | | | | | | | | | | * tests/init.cfg (stderr_fileno_): Reject valgrind if it reports a "Serious error" on a trival use of ‘diff’. Without this patch, on RHEL 8.4 when I compile diffutils with a GCC 11.2.0 that I built myself, ‘valgrind diff’ spits out messages like WARNING: Serious error when reading debug info / When reading debug info from diff: Ignoring non-Dwarf2/3/4 block in .debug_info’ and this causes the strip-trailing-cr test to fail. I guess valgrind complains because the valgrind version 3.16.0 that came with RHEL 8.4 cannot grok the debug entries generated by GCC 11.2.0.
* maint: post-release administriviaJim Meyering2021-08-013-2/+5
| | | | | | * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update.
* version 3.8v3.8Jim Meyering2021-08-011-1/+1
| | | | * NEWS: Record release date.
* build: update gnulib to latestJim Meyering2021-08-011-0/+0
|
* cmp: avoid reading uninitialized memoryJim Meyering2021-07-311-0/+5
| | | | | | | | | | | [This *is* useful, so reapply. ] When comparing buffers a word at a time, cmp could read up to sizeof (word) - 1 uninitialized bytes. * src/cmp.c (cmp): Set not just a single guaranteed-differing sentinel byte just beyond any final read byte, but also ensure that any following bytes are defined, if those may be read via block_compare's word-at-a-time comparison. Reported by Bruno Haible in https://lists.gnu.org/r/diffutils-devel/2021-07/msg00003.html
* cmp: avoid reading uninitialized memoryBruno Haible2021-07-281-0/+4
| | | | | | One or both of the sentinel bytes were copies of uninitialized values. * src/cmp.c (cmp): Use arbitrary initialized values for the sentinel bytes.
* cmp: revert preceding changeJim Meyering2021-07-281-2/+0
| | | | It did not solve the problem. The next patch does.
* cmp: avoid reading uninitialized memoryJim Meyering2021-07-271-0/+2
| | | | | | | | | | When comparing buffers a word at a time, cmp could read up to sizeof (word) - 1 uninitialized bytes. * src/cmp.c (cmp): Set not just a single guaranteed-differing sentinel byte just beyond any final read byte, but also ensure that any following bytes are defined, if those may be read via block_compare's word-at-a-time comparison. Reported by Bruno Haible in https://lists.gnu.org/r/diffutils-devel/2021-07/msg00003.html
* build: update gnulib submodule to latestPaul Eggert2021-07-191-0/+0
|
* diff: better --color helpPaul Eggert2021-05-211-2/+2
| | | | | | * src/diff.c (option_help_msgid): Reword --color help without using the confusing word “default”. Problem reported by Peter Oliver (Bug#48532).
* doc: fix URL in HACKINGPaul Eggert2021-05-201-1/+1
|
* diff: pacify compiler re stylePaul Eggert2021-03-241-1/+1
| | | | | | * src/diff.c (usage): Prefer &"string"[N] to "string" + N. Some compilers complain about the latter, as they worry C++ refugees will think it’s string concatnation.
* diff3: avoid signed int overflowPaul Eggert2021-03-241-10/+13
| | | | | | | * src/diff3.c (main): Avoid signed integer overflow in the very unlikely case of more than INT_MAX incompatible options. Instead, use one bit to record the presence of each type of incompatible option, and report an error if more than one bit is set.
* maint: don’t bother with -Wno-return-local-addrPaul Eggert2021-03-241-7/+0
| | | | | | * configure.ac (WERROR_CFLAGS): Don’t bother with -Wno-return-local-addr as it doesn’t seem to work. Anyway, it’s no longer needed on Ubuntu 20.10.
* maint: disable -Wstack-protectorPaul Eggert2021-03-241-0/+1
| | | | | | * configure.ac (WERROR_CFLAGS): Disable -Wstack-protector, as it has a false alarm with lib/vasnprintf.c on Ubuntu 20.10 and it’s not worth working around. Coreutils already disables it.
* diff: plug memory leak in ifdef.cPaul Eggert2021-03-243-11/+4
| | | | | | | | | | | Problem reported by Than (Bug#47362). Fix the bug by using xmalloca instead of vararrays. * bootstrap.conf (gnulib_modules): Add xmalloca; remove vararrays. * configure.ac: Remove AC_C_VARARRAYS. * src/ifdef.c: Include xmalloca.h instead of xalloc.h. (do_printf_spec): Use xmalloca instead of an xmalloc that lacks a corresponding ‘free’ if HAVE_C_VARARRAYS due to a typo in 2017-05-18T05:51:31Z!meyering@fb.com.
* build: update gnulib submodule to latestPaul Eggert2021-03-241-0/+0
|
* maint: work around GCC -Wreturn-local-addr bugPaul Eggert2021-01-021-0/+4
| | | | | * configure.ac: Do not use -Wreturn-local-addr in Gnulib, to suppress a false alarm in vasnprintf.c.
* maint: update all copyright year number rangesJim Meyering2021-01-0146-50/+64
| | | | | | | 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.
* build: require autoconf-2.64Jim Meyering2020-12-051-1/+1
| | | | * configure.ac: Require 2.64, up from 2.63, to align with gnulib.
* build: update gnulib to latestJim Meyering2020-03-151-0/+0
|
* doc: adjust formatting to make apropos (man -k) work betterJim Meyering2020-03-151-1/+1
| | | | | | | | | * man/Makefile.am $(dist_man1_MANS): Adjust sed substitution to also remove the space after "GNU". This avoids the single leading space on each man page title line. I'm guessing that interfered with indexing/searching, causing "man -k diff3" to print this: diff3 (1) - (unknown subject). Reported by Dan Jacobon in http://bugs.gnu.org/39769.
* doc: correct an ancient "At present"Jim Meyering2020-01-191-2/+2
| | | | | | | * doc/diffutils.texi (Unified Format): Correct the now seriously outdated "At present" (referring to early 1990s) statement to be more of a historical note. Reported by Roland Illig in http://bugs.gnu.org/39184.
* doc: use program name, not "GNU", in the nroff/man headerJim Meyering2020-01-051-1/+2
| | | | | | | * man/Makefile.am (dist_man1_MANS): Elide "GNU " prefix from the generated prog+one-line-summary, so that help2man uses the program name rather than "GNU" as the nroff "name". Reported by Dan Jacobson in http://bugs.gnu.org/38574.
* maint: update all copyright year number rangesJim Meyering2020-01-0146-46/+54
| | | | | | | 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: avoid gnulib-tool deprecation warnings, and build failureJim Meyering2019-12-291-3/+2
| | | | | | | * bootstrap.conf (gnulib_modules): Use getopt-gnu, rather than obsolete "getopt" module. Use nstrftime in place of strftime. (avoided_gnulib_modules): Do not avoid the "lock" module. That would lead to a build failure due to "glthread/lock.h not found".
* maint: avoid syntax-check failureJim Meyering2019-12-291-1/+1
| | | | * po/POTFILES.in: Add argmatch.h; remove xstrtol-error.c
* maint: disable two and reenable many warning optionsJim Meyering2019-12-291-36/+9
| | | | | | | * configure.ac (GNULIB_WARN_CFLAGS): Disable -Wduplicated-branches and -Wreturn-local-addr, due to a couple of false-positive warnings. (WARN_CFLAGS): Reenable many warnings that now (with recent gcc) provoke no false positive.
* maint: avoid gnulib's lock-tests moduleJim Meyering2019-12-291-0/+1
| | | | | * bootstrap.conf (avoided_gnulib_modules): Also --avoid=lock-tests to avoid gnulib-related build failure.
* build: update gnulib to latestJim Meyering2019-12-233-227/+294
| | | | | | * gnulib: Update submodule to latest. * bootstrap: Copy from gnulib. * tests/init.sh: Likewise.
* maint: tweak bootstrap.confJim Meyering2019-12-201-11/+35
| | | | | | | | | * bootstrap.conf (buildreq): Require at least autoconf 2.62, up from 2.61, just as grep and coreutils do. (bootstrap_post_import_hook): "Copy pkg-config's pkg.m4 ...", copied from grep's bootstrap.conf. (avoided_gnulib_modules): Pull this definition to the top. Formatting.
* cmp: add test case for Bug#37558Dave Odell2019-10-011-0/+10
| | | | | * tests/cmp: New test case (Bug#37558). Copyright-paperwork-exempt: yes
* cmp: fix -l width bugPaul Eggert2019-10-011-1/+2
| | | | | | Problem reported by Dave Odell (Bug#37558). * src/cmp.c (cmp): Treat negative ‘bytes’ as infinite, fixing a bug introduced in the 2019-08-27 patch that fixed Bug#35256.
* diff: don’t mistreat -N in arg as a large numberPaul Eggert2019-08-276-30/+35
| | | | | | | | | | | | | | Problem reported by alec (Bug#35256). * NEWS: Mention the fix. * bootstrap.conf (gnulib_modules): Use strtoimax and xstrtoimax, not strtoumax and strtoumax. * src/cmp.c (bytes): Now signed, with -1 representing no limit. All uses changed. * src/cmp.c (specify_ignore_initial, main): * src/diff.c (main): * src/ifdef.c (format_group): * src/sdiff.c (interact): Use strtoimax, not strtoumax.