summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* maint: update prereq version of gettextJim Meyering2016-01-312-55/+4
| | | | | | * configure.ac: Increase designated gettext version to 0.19.2 * bootstrap.conf (buildreq): Likewise. Remove now-unnecessary code to remove gettext-provided files.
* gnulib: update to latestJim Meyering2016-01-312-3/+3
|
* FIXME: src/diff3: plug a leakJim Meyering2016-01-011-0/+1
|
* maint: update copyright year, bootstrap, init.shJim Meyering2016-01-0141-59/+113
| | | | | | | | Run "make update-copyright" and then... * gnulib: Update to latest. * tests/init.sh: Update from gnulib. * bootstrap: Likewise.
* diff --brief no longer mistakenly reports diff. with 0-sized /proc/ filesJim Meyering2015-12-065-1/+43
| | | | | | | | | | | | | | | | Normally, it is safe to assume two regular files are different when their st_size values are different. However, that assumption may be invalid if either value is zero, as happens with files on Linux /proc and /sys file systems. Since skipping this optimization will usually cost very little (one read syscall, to read zero bytes), it is fine to accommodate those unusual files. * src/analyze.c (diff_2_files): Do not assume regular files differ just because their st_size values differ when one or more is 0. * src/diff.c (compare_files): Likewise. * tests/brief-vs-proc-stat-zero: New test. * tests/Makefile.am: Add it. * NEWS (Bug fixes): Describe it. Reported by Stephan Müller in http://debbugs.gnu.org/21942
* tests: arrange to print any skipped-test explanation to tty, tooJim Meyering2015-12-061-0/+1
| | | | | | | | | I noticed that when a test was skipped, the reason was not printed. This fixes it. In coreutils, this variable is set in init.cfg, but there is no point in putting the definition so far from the code that chooses the file descriptor number in tests/Makefile.am. * tests/Makefile.am (TESTS_ENVIRONMENT) [stderr_fileno_]: Define here (to 9), right next to the companion "9>&2".
* build: add gperf to the list of required programsJim Meyering2015-11-291-0/+1
| | | | | * bootstrap.conf (buildreq): Add gperf to the list. Reported by Stephan Müller in http://debbugs.gnu.org/21945
* tests: Add tests for --color and --paletteGiuseppe Scrivano2015-11-292-1/+121
| | | | | * tests/colors: New file. * tests/Makefile.am (TESTS): Add colors.
* doc: mention --color and --palette in NEWSGiuseppe Scrivano2015-11-291-0/+7
|
* diff: add --paletteGiuseppe Scrivano2015-11-296-7/+462
| | | | | | | | | | | | | | | | | | | | | | * bootstrap (gnulib_modules): Add 'argmatch'. * doc/diffutils.texi: Add documentation for --palette * src/diff.h (set_color_palette): New prototype. * src/diff.c (set_color_palette): New function. (color_palette): New variable. * src/utils.c: Include "argmatch.h". (struct bin_str): New struct. (struct color_ext_type): New struct. (color_indicator): New array. (indicator_name): New array. (indicator_no): New enum. (parse_state): New enum. (put_indicator): New function. (get_funky_string): New function. Copied from coreutils ls. (parse_diff_color): New function. Copied from coreutils ls "parse_ls_color" function. (set_color_context): Use put_indicator instead of directly outputting the sequence. * po/POTFILES.in: Add 'lib/argmatch.c'
* diff: add support for --colorGiuseppe Scrivano2015-11-297-58/+471
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/diffutils.texi (diff Options): Add documentation for --color. Copied from coreutils ls --color. * src/context.c (pr_unidiff_hunk): Set the color context. (print_context_header): Likewise. (pr_context_hunk): Likewise. * src/diff.h (enum colors_style): New enum to record when to use colors. (colors_style): New variable to memorize the argument value. (set_color_context): Add function definition. * src/diff.c: : Define COLOR_OPTION. (specify_colors_style): New function. (longopts): Add --color. (main): Handle --color argument. (option_help_msgid): Add usage string for --color. * src/normal.c (print_normal_hunk): Set the color context. * src/side.c (print_1sdiff_line): Likewise. * src/util.c (print_1_line_nl): New function. (print_1_line): Make it a wrapper of 'print_1_line_nl'. (colors_enabled): New boolean variable. (begin_output): Call check_color_output once the output file is configured. (output_1_line): Periodically call `process_signals'. (caught_signals): New sigset_t. (colors_enabled): New boolean variable. (interrupt_signal): New sig_atomic_t. (stop_signal_count): New sig_atomic_t. (check_color_output): New function. (install_signal_handlers): Likewise. Copied from coreutils ls. (process_signals): Likewise. Copied from coreutils ls. (set_color_context): New function. (sighandler): Likewise. Copied from coreutils ls. (stophandler): Likewise. Copied from coreutils ls.
* diff: Improve help text of option --labelAndreas Grünbacher2015-09-241-1/+1
| | | | * src/diff.c (option_help_msgid): Improve help text of option --label.
* build: correct man-page generation ruleJim Meyering2015-09-011-1/+6
| | | | | | | | | | | | | The PATH was set incorrectly, so that the diff used by help2man was the one from $PATH, rather than the just-built one. * man/Makefile.am (bin_dir): New variable, to... (dist_man1_MANS): ...prepend ../src to PATH, not just "..". Also, add a test to ensure that each $(bin_dir)/$$base is executable, so this doesn't happen again. In http://debbugs.gnu.org/21023, Rodrigo Valiña Gutiérrez reported that diff.1 from the diffutils-3.3 tarball contained no description of the then-new --no-dereference option.
* doc: --no-dereference: improve wording/descriptionJim Meyering2015-07-101-5/+4
| | | | | * doc/diffutils.texi (Comparing Directories): Correct grammar. (diff Options) [--no-dereference]: Say a little more.
* maint: update copyright year ranges to include 2015; update gnulibJim Meyering2015-01-0141-55/+59
|
* diff: skip test if seek is not possible on OS/2 kLIBCKO Myung-Hun2014-12-121-0/+7
| | | | | | | | | This fixes the problem that 'diff - file' and 'cat file | diff - file' fail due to a seek failure with a message 'diff.exe: -: Invalid seek', because seek does not work on stdin and a pipe on OS/2 kLIBC. * src/io.c (sip): Set skip_test to true if seek is not possible on OS/2 kLIBC.
* gnulib: update to latestJim Meyering2014-12-091-0/+0
|
* build: double-quote use of $PATHKO Myung-Hun2014-12-091-1/+1
| | | | | | * man/Makefile.am (dist_man1_MANS): On OS/2, PATH_SEPARATOR is ';', but unquoted, that is interpreted as the shell's statement terminator. Quote it.
* diff: fix integer overflow problem with --tabsizePaul Eggert2014-10-273-5/+25
| | | | | | | Reported by Tobias Stoeckmann in: http://bugs.gnu.org/18857 * src/diff.c (main): Don't overflow if INTMAX_MAX / 2 < tabsize. * tests/bignum: New file, to test for this bug. * tests/Makefile.am (TESTS): Add it.
* doc: mention diff -B fix in NEWSPaul Eggert2014-09-031-0/+3
|
* diff: fix bug with diff -B and incomplete linesPaul Eggert2014-09-032-2/+10
| | | | | | | | Reported by Navin Kabra via Eric Blake in: http://bugs.gnu.org/18402 * src/util.c (analyze_hunk): Don't mishandle incomplete lines at end of file. * tests/no-newline-at-eof: Test for the bug.
* diff: fix performance bug with prefix computationPaul Eggert2014-09-031-3/+5
| | | | | | | * src/io.c (find_identical_ends): Fix performance bug: the test for when the prefix was needed messed up by the 2002-02-28 integer-overflow fixes, causing performance to be worse than it needed to be.
* gnulib: update to latest, as well as bootstrapJim Meyering2014-08-232-47/+69
|
* maint: update copyright year range in texinfo documentationJim Meyering2014-08-231-1/+1
| | | | * doc/diffutils.texi: Update copyright.
* maint: update bug-reporting addressJim Meyering2014-04-152-3/+3
| | | | | | * README: Change bug-gnu-utils@... to bug-diffutils@gnu.org. * doc/diffutils.texi: Likewise. Reported by Jamie Landeg Jones.
* diff: fix two "..." typos in --help outputPaul Eggert2014-03-261-1/+1
| | | | * src/diff.c (option_help_msgid): Remove two "..." typos (Bug#17102).
* doc: improve documentation about reading and stdinPaul Eggert2014-03-251-2/+6
| | | | | | | See Bug#17075. * doc/diffutils.texi (Comparison): Say that files need not be read. (Invoking diff): Remove confusing remark about 'diff - -'. It's not that useful, and it's not portable anyway.
* diff, sdiff: minor integer overflow fixesPaul Eggert2014-02-244-14/+22
| | | | | | | | | | * src/context.c (find_hunk): Simplify, now that 2 * context + 1 cannot overflow. * src/diff.c (main): * src/sdiff.c (interact): Don't rely on undefined behavior on signed integer overflow. * src/diff.c (main): Don't let contexts exceed CONTEXT_MAX. * src/system.h (CONTEXT_MAX): New macro.
* diff: fix bug with -I and overlapping hunksPaul Eggert2014-02-243-4/+51
| | | | | | | | Problem reported by Vincent Lefevre in <http://bugs.gnu.org/16864>. * src/context.c (find_hunk): Threshold is CONTEXT only if the second change is ignorable. * tests/ignore-matching-lines: New test. * tests/Makefile.am (TESTS): Add it.
* diff: remove TOO_EXPENSIVE heuristicPaul Eggert2014-02-233-18/+17
| | | | | | | | | | | | | Problem reported by Vincent Lefevre in <http://bugs.gnu.org/16848>. The simplest solution is to remove the TOO_EXPENSIVE heuristic that I added to GNU diff in 1993. Although appropriate for circa-1993 hardware, these days the heuristic seems to be more trouble than it's worth. * NEWS: Document this. * doc/diffutils.texi (Overview): Modernize citations. Remove mention of TOO_EXPENSIVE heuristic. * src/analyze.c (diff_2_files): Adjust to TOO_EXPENSIVE-related API changes in gnulib's diffseq module.
* build: update gnulib submodule to latestPaul Eggert2014-02-231-0/+0
|
* diff: exit with status 1, not 2, when binary files differPaul Eggert2014-01-314-33/+17
| | | | | | | | | Problem reported by Vincent Lefevre in <http://bugs.gnu.org/16608>. * NEWS: * doc/diffutils.texi (Binary, Invoking diff): Document this. * src/analyze.c (briefly_report): Return void, not int. All uses changed. Do not futz with exit status. Simplify. * tests/binary: Adjust to match new behavior.
* build: omit -Wsuggest-attribute=pure for libPaul Eggert2013-09-261-0/+1
| | | | | | * configure.ac (WARN_CFLAGS): Omit -Wsuggest-attribute=pure when compiling the lib subdirectory. Reported for Fedora 19 by Eric Blake in <http://bugs.gnu.org/15463>.
* cmp, diff, sdiff: tune by using rawmemchrPaul Eggert2013-08-224-72/+51
| | | | | | | | | | | | | | | On my platform (AMD Phenom II X4 910e, Fedora 17 x86-64), this sped up 'cmp -n 8GiB /dev/full /dev/zero' by a factor of 3.8, and 'cmp -sn 8GiB /dev/full /dev/zero' by a factor of 1.8. * bootstrap.conf (gnulib_modules): Add rawmemchr. * src/cmp.c (cmp): Optimize the common case where buffers are the same, by using count_newlines rather than block_compare_and_count. (block_compare_and_count): Remove. (count_newlines): New function. * src/cmp.c (count_newlines): * src/io.c (prepare_text): * src/sdiff.c (lf_copy, lf_skip, lf_snarf): Use rawmemchr instead of memchr, for speed.
* cmp: tune 'cmp a b' for GCC x86Paul Eggert2013-08-121-2/+4
| | | | | | | Performance problem reported by David Balažic in: http://lists.gnu.org/archive/html/bug-diffutils/2013-08/msg00013.html * src/system.h (word): Make it size_t, not uintmax_t. This sped up plain cmp 90% on my tests (GCC 4.8.1, x86).
* build: update gnulib submodule to latestPaul Eggert2013-07-061-0/+0
|
* build: enable 'subdir-objects' automake optionStefano Lattarini2013-05-061-1/+3
| | | | | | | | | | The future major Automake version (2.0, ETA at least one year from now) might enable that option unconditionally, so better get prepared in due time. * configure.ac (AM_INIT_AUTOMAKE): Adjust. (AM_PROG_CC_C_O): New, required by Automake up to 1.13.x when the 'subdir-objects' is in use.
* build: update gnulib submodule to latestPaul Eggert2013-04-281-0/+0
|
* diff: fix bug with Asian file namesPaul Eggert2013-04-034-2/+39
| | | | | | | | | | | | Problem reported by Errembault Philippe in: http://lists.gnu.org/archive/html/bug-diffutils/2013-03/msg00012.html * NEWS: Document this. * src/dir.c (compare_names): Fall back on file_name_cmp if compare_collated returns 0, unless ignoring file name case. (diff_dirs): Don't bother with the O(N**2) stuff unless ignoring file name case. * tests/Makefile.am (TESTS): Add strcoll-0-names. * tests/strcoll-0-names: New file.
* diff: remove unnecessary declPaul Eggert2013-04-031-1/+0
| | | | | * src/dir.c (compare_names_for_qsort): Remove declaration. Not needed now that we assume C89.
* diff: tune compare_names_for_qsortPaul Eggert2013-04-031-18/+31
| | | | | | | | * src/dir.c (compare_collated): New function. (compare_names): Use it. (compare_names_for_qsort): Use it. This is a bit more efficient as it can avoid a double invocation of file_name_cmp when file_name_cmp returns zero.
* doc: mention new option, --no-dereference in 3.3's NEWSJim Meyering2013-03-302-1/+7
| | | | | | | * NEWS (New feeatures): Update 3.3's news to mention --no-dereference. Reported by Denis Excoffier. * Makefile.am (old_NEWS_hash): Update, since this modifies old, and normally-immutable NEWS.
* tests: port to Solaris 10 /bin/shPaul Eggert2013-03-261-21/+21
| | | | | | | * tests/Makefile.am (TESTS_ENVIRONMENT): Use "FOO=val; export FOO" rather than "export FOO=val", as the latter form doesn't work with Solaris /bin/sh. Problem found when trying to run "make check" on Solaris 10.
* maint: post-release administriviaJim Meyering2013-03-243-2/+5
| | | | | | * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update.
* version 3.3v3.3Jim Meyering2013-03-241-1/+1
| | | | * NEWS: Record release date.
* doc: fix menu typoPaul Eggert2013-03-231-1/+1
| | | | | * doc/diffutils.texi (Comparing Three Files): Fix out-of-order menu. Bug caught by Texinfo 5.0.
* maint: update build procedure to recent gettext etc.Paul Eggert2013-03-233-46/+39
| | | | | | | | | | | | | | * bootstrap.conf (gnulib_modules): Add vararrays. (needed_gnulib_files, unnecessary_gettext_files): New vars. (bootstrap_post_import_hook): New function, to implement these vars. (excluded_files): Remove; 'bootstrap' no longer supports this. Its function is now performed by unnecessary_gettext_files. (buildreq): Update automake to 1.12.2, to avoid CVE-2012-3386. * configure.ac (AM_GNU_GETTEXT_VERSION): Bump from 0.17 to 0.18.2, to lessen the probability that we'll have outlandishly old files during a build. * m4/vararrays.m4: Remove from repository, as we now use the gnulib version.
* build: update gnulib to latest and adapt; update bootstrap, tooJim Meyering2013-03-214-44/+31
| | | | | | | | | | Blindly updating to the latest from gnulib, bootstrap would fail due to failure of our local patches to apply. Hence, these first two updates. * gl/lib/regex_internal.c.diff: Update offsets, so this patch applies to the latest from gnulib. * gl/lib/regex_internal.h.diff: Remove file. No longer needed. * bootstrap: Update from gnulib.
* tests: port to hosts lacking fmt, make -CPaul Eggert2013-01-061-2/+2
| | | | | * tests/Makefile.am (built_programs): Don't assume fmt works. Don't rely on 'make -C', either.
* maint: update .gitignore for recent gnulibPaul Eggert2013-01-061-0/+22
| | | | * .gitignore: Add tests/*.trs and several *.h and *.sed files in lib,