summaryrefslogtreecommitdiff
path: root/src/context.c
Commit message (Collapse)AuthorAgeFilesLines
* maint: update all copyright year number rangesJim Meyering2012-01-011-1/+1
| | | | 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: remove inclusion of unused header, for "make syntax-check"Jim Meyering2011-07-031-1/+0
| | | | | * src/diff3.c: Don't include <inttostr.h>. Not used. * src/context.c: Likewise.
* maint: update copyright year ranges to include 2011Jim Meyering2011-01-031-1/+1
| | | | Run "make update-copyright", so "make syntax-check" works in 2011.
* diff -F/-p: don't depend on locale-specific white-space definitionJim Meyering2010-04-051-2/+3
| | | | | * src/context.c: Include "c-ctype.h". Use c_isspace, not isspace.
* with -F or -p, emit better function lines: no leading white spaceYannick Moy2010-03-181-5/+7
| | | | | | | | | | * src/diff.c (print_context_function): For languages like Ada that allow local functions and procedures, the plain context function line may start with enough blank characters that the function name does not get completely printed in the 40 characters limit. This patch solves this problem by removing these useless initial blank characters. * NEWS (Changes in behavior): Mention this change.
* maint: update all FSF copyright year lists to include 2010Jim Meyering2010-01-011-1/+1
| | | | | | Use this command: git ls-files |grep -vE '^(\..*|COPYING|gnulib)$' |xargs \ env UPDATE_COPYRIGHT_USE_INTERVALS=1 build-aux/update-copyright
* admin: update all copyright notices to include the year 2009Jim Meyering2009-11-111-2/+2
|
* * NEWS: New diff option --suppress-blank-empty (no longer -u default).Paul Eggert2009-11-111-5/+7
| | | | | | | | | | | | * doc/diff.texi (Detailed Unified): Trailing spaces are no longer omitted. (Trailing Blanks): New section. (diff Options) Mention new option. * src/diff.h (suppress_blank_entry): New decl. * src/context.c (pr_unidiff_hunk): Support --suppress-blank-empty. * src/util.c (print_1_line): Likewise. * src/diff.c (longopts, main, option_help_msgid): Likewise. (SUPPRESS_BLANK_EMPTY_OPTION): New constant.
* * COPYING: New file.Paul Eggert2007-07-191-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* (print_context_label): Use TYPE_IS_INTEGER macro rather than rollingPaul Eggert2007-06-181-1/+1
| | | | it ourselves.
* * src/context.c (print_context_label): Don't assume that time_tPaul Eggert2007-06-181-3/+17
| | | | | | fits in long int, since it doesn't in FreeBSD/arm. Problem reported by Xin Li in <http://lists.gnu.org/archive/html/bug-gnu-utils/2007-06/msg00091.html>.
* * doc/diff.texi (Detailed Unified): Don't output trailing whitePaul Eggert2006-09-051-2/+4
| | | | | space unless the input data has it. * src/context.c (pr_unidiff_hunk): Likewise.
* * src/context.c (print_context_function): Do not printPaul Eggert2006-09-051-0/+2
| | | | trailing white space in a context header.
* * src/context.c (pr_context_hunk, pr_unidiff_hunk):Paul Eggert2006-05-071-8/+8
| | | | | | | | | | | | | 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.
* Update FSF address.Paul Eggert2006-01-051-1/+1
|
* * src/cmp.c: Don't include <setmode.h>.Paul Eggert2006-01-051-110/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (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.
* (find_function_last_search): Move into struct diffopt.Paul Eggert2004-09-011-91/+98
| | | | | | | | | 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.
* Do not include regex.h, as diff.h does this now.Paul Eggert2004-04-121-9/+9
|
* (pr_context_hunk): Do not dump core if an enormous context causes anPaul Eggert2002-02-281-13/+36
| | | | | | arithmetic overflow. (pr_unidiff_hunk): Likewise. (find_hunk): Likewise.
* Assume C89 or better.Paul Eggert2001-11-241-110/+106
| | | | | | | | | | | | int -> lin for line numbers. Include inttostr.h, regex.h. (TIMESPEC_NS): New macro. (nstrftime): New decl. (print_context_label): Use nstrftime and time_format to format times. Print numeric time stamp value if localtime fails. (print_context_function): New function. (pr_context_hunk, pr_unidiff_hunk): Use it. (find_function): Use size_t for sizes, not int.
* Fix spacing.Paul Eggert1998-09-141-1/+1
|
* Fix spacing.Paul Eggert1998-09-131-14/+15
|
* (find_function): Simplify interface: don't return size of function line.Paul Eggert1994-10-311-42/+32
| | | | | | | All callers changed. function_regexp_list -> function_regexp (print_context_script, pr_context_hunk, pr_unidiff_hunk): ignore_regexp_list -> ignore_regexp.fastmap (print_context_script, find_function): INT_MAX now denotes no previous match;
* Fix copyright notice.Paul Eggert1994-09-121-1/+1
|
* (print_context_label): Check whether (broken) ctime yields 0.Paul Eggert1994-09-021-4/+8
|
* Add prototypes to function declarations. Use size_t, not int, when needed.Paul Eggert1993-08-271-28/+30
| | | | | | Use `const' when needed to pacify gcc. (print_context_label): Standard input's st_mtime is no longer a special case here, since `compare_files' now sets it to the current time.
* entered into RCSPaul Eggert1992-10-191-3/+3
|
* *** empty log message ***Paul Eggert1992-09-271-3/+3
|
* *** empty log message ***Paul Eggert1992-09-061-20/+20
|
* *** empty log message ***David MacKenzie1992-07-071-16/+17
|
* Initial revisionDavid MacKenzie1991-12-241-0/+461