Hello community,
here is the log from the commit of package wdiff for openSUSE:Factory
checked in at Tue Sep 1 22:55:17 CEST 2009.
--------
--- wdiff/wdiff.changes 2008-02-24 22:22:47.000000000 +0100
+++ wdiff/wdiff.changes 2009-08-26 14:18:13.000000000 +0200
@@ -1,0 +2,16 @@
+Wed Aug 26 12:53:54 CEST 2009 - mls@suse.de
+
+- make patch0 usage consistent
+
+-------------------------------------------------------------------
+Wed Aug 5 01:27:04 CEST 2009 - jw@suse.de
+
+- updated to GNU wdiff 0.5.93,
+- removed upstreamed/opbsoleted patches,
+- rediffed -c patch by Hans Lermen.
+- added linenumbers to -c output
+- added -A -B -U options to simplify -w -x -y -z settings
+- added dummy -L option for compat with diff.
+- documentation updated.
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
wdiff-0.5.2-diff.patch
wdiff-0.5.2-nb.patch
wdiff-0.5.2-tempfile.patch
wdiff-0.5.2.dif
wdiff-0.5.2.tar.bz2
New:
----
happy-gcc.patch
linenumber_ansi.patch
wdiff-0.5.93-diff.patch
wdiff-0.5.93-lermen.patch
wdiff-0.5.93.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ wdiff.spec ++++++
--- /var/tmp/diff_new_pack.0PEeCH/_old 2009-09-01 22:51:01.000000000 +0200
+++ /var/tmp/diff_new_pack.0PEeCH/_new 2009-09-01 22:51:01.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package wdiff (Version 0.5.2)
+# spec file for package wdiff (Version 0.5.93)
#
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -21,17 +21,21 @@
Name: wdiff
BuildRequires: ncurses-devel
Url: http://www.gnu.org/software/wdiff/
-License: GPL v2 or later
+License: GPLv2+
Group: Productivity/Text/Utilities
AutoReqProv: on
-Version: 0.5.2
-Release: 797
+Version: 0.5.93
+Release: 1
Summary: Display Word Differences Between Text Files
-Source: wdiff-%{version}.tar.bz2
-Patch: wdiff-%{version}.dif
-Patch1: wdiff-%{version}-tempfile.patch
+Source: http://alpha.gnu.org/gnu/wdiff/wdiff-%{version}.tar.bz2
+Patch: wdiff-%{version}-lermen.patch
Patch2: wdiff-%{version}-diff.patch
-Patch3: wdiff-%{version}-nb.patch
+Patch3: happy-gcc.patch
+Patch4: linenumber_ansi.patch
+# upstreamed
+# Patch1: wdiff-%{pversion}-tempfile.patch
+# obsoleted by autoconf
+# Patch3: wdiff-%{pversion}-nb.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
PreReq: %install_info_prereq
@@ -51,16 +55,17 @@
%prep
%setup -q
-%patch0
-%patch1
-%patch2
-%patch3
-rename no nb po/no.*
+%patch -p1
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
%build
-autoreconf -fi
+# those autoconf tools never really work, do they?
+# error: AC_REQUIRE: circular dependency of AC_GNU_SOURCE
+# autoreconf -fi
LIBS=-lncurses \
-CFLAGS="$RPM_OPT_FLAGS -pipe -DLERMEN_STUFF" \
+CFLAGS="$RPM_OPT_FLAGS -pipe -DPROTOTYPES -DLERMEN_STUFF" \
GETOPT="" \
%configure
make
@@ -68,6 +73,7 @@
%install
make "DESTDIR=$RPM_BUILD_ROOT" install
install -m 755 src/xwdiff $RPM_BUILD_ROOT/usr/bin
+rm -rf $RPM_BUILD_ROOT/usr/share/locale/no
%find_lang %{name}
%files -f %{name}.lang
@@ -75,6 +81,7 @@
%doc BACKLOG ChangeLog NEWS README* THANKS TODO ABOUT-NLS AUTHORS COPYING
%{_infodir}/wdiff.info*
/usr/bin/*
+%{_mandir}/man1/*
%clean
rm -rf %{buildroot}
++++++ happy-gcc.patch ++++++
--- wdiff-0.5.93/src/wdiff.c.orig 2009-08-04 00:03:26.000000000 +0200
+++ wdiff-0.5.93/src/wdiff.c 2009-08-04 19:06:29.563764000 +0200
@@ -44,6 +44,8 @@
/* Library declarations. */
#include
+#include
+#include
#if STDC_HEADERS
# include
@@ -537,7 +539,7 @@ real_end_of_insert (void)
| We say "white space", but we actually mean space or punctuation |
`----------------------------------------------------------------*/
-#define is_space_or_punct(c) (isspace(c) || ignore_punct && ispunct(c))
+#define is_space_or_punct(c) (isspace(c) || (ignore_punct && ispunct(c)))
/*--------------------------------.
| Skip over white space on SIDE. |
@@ -1010,16 +1012,20 @@ reformat_diff_output (void)
}
if (!inhibit_left)
- if (!inhibit_common && inhibit_right)
- copy_until_ordinal (left_side, resync_left);
- else
- skip_until_ordinal (left_side, resync_left);
+ {
+ if (!inhibit_common && inhibit_right)
+ copy_until_ordinal (left_side, resync_left);
+ else
+ skip_until_ordinal (left_side, resync_left);
+ }
if (!inhibit_right)
- if (inhibit_common)
- skip_until_ordinal (right_side, resync_right);
- else
- copy_until_ordinal (right_side, resync_right);
+ {
+ if (inhibit_common)
+ skip_until_ordinal (right_side, resync_right);
+ else
+ copy_until_ordinal (right_side, resync_right);
+ }
if (!inhibit_common && inhibit_left && inhibit_right)
copy_until_ordinal (right_side, resync_right);
@@ -1049,19 +1055,21 @@ reformat_diff_output (void)
right file is used merely to show common words. */
if (directive == 'a' || directive == 'c')
- if (inhibit_right)
- {
- if (!inhibit_common && inhibit_left)
- skip_until_ordinal (right_side, argument[3]);
- }
- else
- {
- copy_whitespace (right_side, output_file);
- start_of_insert ();
- copy_word (right_side, output_file);
- copy_until_ordinal (right_side, argument[3]);
- end_of_insert ();
- }
+ {
+ if (inhibit_right)
+ {
+ if (!inhibit_common && inhibit_left)
+ skip_until_ordinal (right_side, argument[3]);
+ }
+ else
+ {
+ copy_whitespace (right_side, output_file);
+ start_of_insert ();
+ copy_word (right_side, output_file);
+ copy_until_ordinal (right_side, argument[3]);
+ end_of_insert ();
+ }
+ }
}
}
--- wdiff-0.5.93/src/unify.c.orig 2008-06-20 20:45:57.000000000 +0200
+++ wdiff-0.5.93/src/unify.c 2009-08-04 19:12:22.457735000 +0200
@@ -23,6 +23,7 @@
#include "system.h"
#include
#include
+#include
/* FIXME: Programs should not have such limits. */
#define NAME_LENGTH 255
@@ -331,7 +332,7 @@ main (int argc, char *const *argv)
char previous_start = ' ';
char star_in_cdiff; /* if '*' seen in a new-style context diff */
- char type;
+ char type = ' '; // gcc warns: may be used uninitialized
program_name = argv[0];
setlocale (LC_ALL, "");
@@ -481,12 +482,12 @@ Written by Wayne Davison
+#include
+#include
#if STDC_HEADERS
# include
@@ -313,7 +315,7 @@ static int rcs = 0;
static int side_by_side = 0;
/* Output at most NUM characters per line. */
-static int width = 130;
+// static int width = 130;
/* Output only the left column of common lines. */
static int left_column = 0;
@@ -346,7 +348,7 @@ static int new_file = 0;
static int unidirectional_new_file = 0;
/* Report when two files are the same. */
-static int report_identical_files = 0;
+// static int report_identical_files = 0;
/* Exclude files that match PAT. */
static const char *exclude = NULL;
@@ -1057,17 +1059,17 @@ study_input (struct input *input)
{
#if SAVE_AND_SLOW
# define ADJUST_CHECKSUM(Character) \
- checksum = (checksum << 5) + (checksum >> BITS_PER_WORD - 5) \
+ checksum = (checksum << 5) + (checksum >> (BITS_PER_WORD - 5)) \
+ (Character & 0xFF)
#else
# define ADJUST_CHECKSUM(Character) \
- checksum = (checksum << 5) + (checksum >> BITS_PER_WORD - BITS_PER_TYPE - 5) \
+ checksum = (checksum << 5) + (checksum >> (BITS_PER_WORD - BITS_PER_TYPE - 5)) \
+ (Character & 0xFF)
#endif
int item_count; /* number of items read */
- char *buffer; /* line buffer */
- int length; /* actual line length in buffer */
+ char *buffer = NULL; /* line buffer */
+ int length = 0; /* actual line length in buffer */
/* Read the file and checksum all items. */
@@ -1140,15 +1142,17 @@ study_input (struct input *input)
if (isspace (*cursor))
{
if (!ignore_all_space)
- if (ignore_space_change)
- {
- ADJUST_CHECKSUM (' ');
- while (cursor + 1 < buffer + length
- && isspace (cursor[1]))
- cursor++;
- }
- else
- ADJUST_CHECKSUM (*cursor);
+ {
+ if (ignore_space_change)
+ {
+ ADJUST_CHECKSUM (' ');
+ while (cursor + 1 < buffer + length
+ && isspace (cursor[1]))
+ cursor++;
+ }
+ else
+ ADJUST_CHECKSUM (*cursor);
+ }
}
else if (isalpha (*cursor))
{
@@ -1329,7 +1333,7 @@ reference_string (int number)
struct reference reference;
static char buffer[RING_LENGTH][20];
- static next = RING_LENGTH - 1;
+ static int next = RING_LENGTH - 1;
if (next == RING_LENGTH - 1)
next = 0;
@@ -1527,6 +1531,7 @@ dump_member (struct member *member)
| Dump all members. |
`-------------------*/
+# if 0
static void
dump_all_members (void)
{
@@ -1536,6 +1541,7 @@ dump_all_members (void)
for (counter = 0; counter < members; counter++)
dump_member (member_array + counter);
}
+# endif
#endif /* DEBUGGING */
@@ -1608,12 +1614,13 @@ new_member (int item)
| Output a cluster explanation line. |
`------------------------------------*/
+# if 0
static void
explain_member (char prefix, struct member *quote)
{
struct cluster *cluster = cluster_array + quote->cluster_number;
struct member *member;
- int counter;
+ // int counter;
struct reference reference;
putc (prefix, output_file);
@@ -1628,6 +1635,7 @@ explain_member (char prefix, struct memb
}
putc ('\n', output_file);
}
+# endif
/*----------------------.
| Search for clusters. |
@@ -1654,7 +1662,7 @@ prepare_clusters (void)
of INDIRECT_ITEM_ARRAY, between FIRST and LAST (included). */
int *sorter_array = NULL; /* for ensuring members are in nice order */
int sorters; /* number of members in sorter_array */
- int *sorter; /* cursor into sorter_array */
+ // int *sorter; /* cursor into sorter_array */
int *cursor; /* cursor into sorter_array */
ITEM *item; /* cursor in item_array */
@@ -1899,8 +1907,8 @@ prepare_indirects (void)
{
int counter;
struct member *member;
- struct input *input;
- int duplicated_items;
+ // struct input *input;
+ // int duplicated_items;
#if DEBUGGING
if (debugging)
@@ -2011,7 +2019,7 @@ explain_group (char prefix, struct mergi
struct cluster *cluster
= cluster_array + member_array[merging->member_number].cluster_number;
int counter;
- struct input *input;
+ // struct input *input;
struct member *member;
struct merging *cursor;
struct reference reference;
@@ -2067,7 +2075,7 @@ prepare_mergings (void)
struct cluster *cluster; /* current cluster candidate */
int cost; /* cost associate with current candidate */
struct cluster *best_cluster; /* best cluster candidate for hunk */
- int best_cost; /* cost associated with best cluster */
+ int best_cost = 0; /* cost associated with best cluster */
int group_flag; /* set if next merging starts group */
/* Remove member overlaps. */
@@ -2216,12 +2224,14 @@ prepare_mergings (void)
#if DEBUGGING
if (debugging)
- if (best_cluster)
- fprintf (stderr, " {%d}=%d <-> {%d}=%d\n",
- best_cluster - cluster_array, best_cost,
- cluster - cluster_array, cost);
- else
- fprintf (stderr, " {%d}=%d\n", cluster - cluster_array, cost);
+ {
+ if (best_cluster)
+ fprintf (stderr, " {%d}=%d <-> {%d}=%d\n",
+ best_cluster - cluster_array, best_cost,
+ cluster - cluster_array, cost);
+ else
+ fprintf (stderr, " {%d}=%d\n", cluster - cluster_array, cost);
+ }
#endif
if (!best_cluster || cost < best_cost)
{
@@ -2238,7 +2248,7 @@ prepare_mergings (void)
#if DEBUGGING
if (debugging)
{
- fprintf (stderr, "\nCHOICE\t", best_cluster);
+ fprintf (stderr, "\nCHOICE\t");
dump_cluster (best_cluster);
putc ('\n', stderr);
}
@@ -2550,7 +2560,7 @@ output_characters (const char *string, i
static unsigned column = 0;
const char *cursor;
- int counter;
+ // int counter;
if (overstrike || expand)
for (cursor = string; cursor < string + length; cursor++)
@@ -2676,7 +2686,7 @@ output_characters (const char *string, i
break;
}
else
- fwrite (string, length, 1, output_file);
+ (void)fwrite (string, length, 1, output_file);
}
/*------------------------------------------------------------------------.
@@ -2873,11 +2883,14 @@ make_margin (struct input *input, enum m
char buffer[15];
char *cursor;
- if (margin == EMPTY_MARGIN)
- return;
+ // if (margin == EMPTY_MARGIN)
+ // return;
switch (margin)
{
+ case EMPTY_MARGIN:
+ return;
+
case LOCATION_IN_MARGIN:
sprintf (buffer, "%s%d", input->nick_name,
input->item - input->first_item + 1);
@@ -3129,13 +3142,13 @@ relist_annotated_files (void)
enum margin_mode margin_mode = show_links ? LOCATION_IN_MARGIN : EMPTY_MARGIN;
- struct input *input;
+ struct input *input = NULL;
int *cursor;
int counter;
- FILE *file;
+ // FILE *file;
ITEM *item;
struct active *active;
- struct member *member;
+ struct member *member = NULL;
struct cluster *cluster;
int ordinal;
struct reference reference;
@@ -3472,8 +3485,8 @@ relist_merged_lines (int unified, int cr
int counter;
struct input *input;
struct member *member;
- struct cluster *chosen_cluster;
- struct reference reference;
+ // struct cluster *chosen_cluster;
+ // struct reference reference;
struct merging *merging;
struct merging *group_limit;
struct merging *cursor;
@@ -3583,8 +3596,8 @@ relist_merged_words (void)
int counter;
struct input *input;
struct member *member;
- struct cluster *chosen_cluster;
- struct reference reference;
+ // struct cluster *chosen_cluster;
+ // struct reference reference;
struct merging *merging;
struct merging *group_limit;
struct merging *cursor;
@@ -4076,7 +4089,7 @@ int
main (int argc, char *const *argv)
{
int option_char; /* option character */
- struct input *input; /* cursor in input array */
+ // struct input *input; /* cursor in input array */
int inhibit_left = 0;
int inhibit_right = 0;
--- wdiff-0.5.93/src/wdiff2.c.orig 2008-06-20 22:34:36.000000000 +0200
+++ wdiff-0.5.93/src/wdiff2.c 2009-08-04 19:08:44.965479000 +0200
@@ -28,6 +28,8 @@
#define EXIT_FAILURE 2 /* any other reason for exit */
#include
+#include // LC_ALL
+#include // execvp
const char *program_name; /* name of executing program */
--- wdiff-0.5.93/src/readpipe.c.orig 2007-07-12 02:26:09.000000000 +0200
+++ wdiff-0.5.93/src/readpipe.c 2009-08-04 19:18:10.741062000 +0200
@@ -80,7 +80,8 @@ readpipe (va_alist)
close (1); /* We don't want the old stdout. */
if (dup (fds[1]) == 0)/* Maybe stdin was closed. */
{
- dup (fds[1]); /* Guaranteed to dup to 1 (stdout). */
+ if (1 != dup (fds[1])) /* Guaranteed to dup to 1 (stdout). */
+ _exit(3);
close (0);
}
close (fds[1]); /* No longer needed. */
--- wdiff-0.5.93/src/writepipe.c.orig 2007-07-12 02:26:09.000000000 +0200
+++ wdiff-0.5.93/src/writepipe.c 2009-08-04 19:17:56.878247000 +0200
@@ -78,7 +78,8 @@ writepipe (va_alist)
if (fds[0] != 0) /* Redirect 0 (stdin) only if needed. */
{
close (0); /* We don't want the old stdin. */
- dup (fds[0]); /* Guaranteed to dup to 0 (stdin). */
+ if (0 != dup (fds[0])) /* Guaranteed to dup to 0 (stdin). */
+ _exit(4);
close (fds[0]); /* No longer needed. */
}
execvp (args[0], args);
++++++ linenumber_ansi.patch ++++++
--- wdiff-0.5.93/doc/wdiff.texi.orig 2008-06-19 15:54:14.000000000 +0200
+++ wdiff-0.5.93/doc/wdiff.texi 2009-08-06 11:25:21.000000000 +0200
@@ -767,6 +767,45 @@ or underlining. Finally, if this option
@samp{-1} and @samp{-2} are, then sections of common words between
differences are segregated by lines of dashes.
+@item --ansi-red-green
+@itemx -A
+Highlight deleted text in red, inserted text in green. This uses ansi terminal codes.
+This highlighting is done in addition to the normal markers.
+
+@item --bold-inserted
+@itemx -A
+Highlight inserted text in bold face. This uses ansi terminal codes.
+This highlighting is done in addition to the normal markers.
+
+@item --copyright
+@itemx -C
+Print copyright and exit.
+
+@item --no-init-term
+@itemx -K
+Like @samp{-t}, but no termcap init/term strings.
+
+@item --Label @var{argument}
+@itemx -L @var{argument}
+A dummy option for compatibility with GNU @code{diff}.
+
+@item --punctuation
+@itemx -P
+Treat punctuation (@code{ispunct()}) like whitespace (@code{isspace()}).
+
+@item --underline-deleted
+@itemx -U
+Underline deleted text. This uses ansi terminal codes.
+This highlighting is done in addition to the normal markers.
+
+@item --context @var{N}
+@itemx -c @var{N}
+Like @samp{-3}, but only print @var{N} lines of context around each
+difference. Context blocks are seperated by a horizontal line, and are
+preceeded by a line of the format @code{=== @var{LLL},@var{RRR} ===}, where
+@var{LLL} and @var{RRR} are current line numbers in the left and right file,
+respectively.
+
@item --ignore-case
@itemx -i
Do not consider case difference while comparing words. Each lower case
--- wdiff-0.5.93/man/wdiff.1.orig 2009-08-04 22:25:02.000000000 +0200
+++ wdiff-0.5.93/man/wdiff.1 2009-08-06 11:27:33.000000000 +0200
@@ -10,12 +10,27 @@ wdiff \- Compares words in two files and
.PP
Mandatory arguments to long options are mandatory for short options too.
.TP
+\fB\-A\fR, \fB\-\-ansi\-red\-green\fR
+highlight deleted text in red, added text in green; using ansi terminal codes
+.TP
+\fB\-B\fR, \fB\-\-bold\-inserted\fR
+mark inserted text in bold; using ansi terminal codes
+.TP
\fB\-C\fR, \fB\-\-copyright\fR
print copyright then exit
.TP
\fB\-K\fR, \fB\-\-no\-init\-term\fR
like \fB\-t\fR, but no termcap init/term strings
.TP
+\fB\-L\fR \fIdummy\fR, \fB\-\-label\fR=\fIdummy\fR
+dummy option for \fBdiff\fR compatibility
+.TP
+\fB\-P\fR, \fB\-\-punctuation\fR
+treat punctuation (ispunct()) like whitespace (isspace())
+.TP
+\fB\-U\fR, \fB\-\-underline\-deleted\fR
+underline deleted text; using ansi terminal codes
+.TP
\fB\-1\fR, \fB\-\-no\-deleted\fR
inhibit output of deleted words
.TP
@@ -28,6 +43,13 @@ inhibit output of common words
\fB\-a\fR, \fB\-\-auto\-pager\fR
automatically calls a pager
.TP
+\fB\-c\fR\fIN\fR, \fB\-\-context\fR=\fIN\fR
+like \fB-3\fR, but only print N lines of context around each difference.
+Context blocks are seperated by a horizontal line, and
+are preceeded by a line of the format '=== \fILLL\fR,\fIRRR\fR ===', where
+\fILLL\fR and \fIRRR\fR are current line numbers in the left and right
+file, respectively.
+.TP
\fB\-h\fR, \fB\-\-help\fR
print this help
.TP
@@ -53,18 +75,19 @@ use termcap as for terminal displays
print program version then exit
.TP
\fB\-w\fR, \fB\-\-start\-delete\fR=\fISTRING\fR
-string to mark beginning of delete region
+string to mark beginning of delete region; default '[-'
.TP
\fB\-x\fR, \fB\-\-end\-delete\fR=\fISTRING\fR
-string to mark end of delete region
+string to mark end of delete region; default '-]'
.TP
\fB\-y\fR, \fB\-\-start\-insert\fR=\fISTRING\fR
-string to mark beginning of insert region
+string to mark beginning of insert region; default '{+'
.TP
\fB\-z\fR, \fB\-\-end\-insert\fR=\fISTRING\fR
-string to mark end of insert region
+string to mark end of insert region; default '+}'
.SH AUTHOR
Written by Franc,ois Pinard .
+Patches by Hans Lermen (1994), Juergen Weigert
.SH "REPORTING BUGS"
Report bugs to .
.SH COPYRIGHT
--- wdiff-0.5.93/src/wdiff.c.orig 2009-08-04 22:24:16.000000000 +0200
+++ wdiff-0.5.93/src/wdiff.c 2009-08-06 10:52:16.000000000 +0200
@@ -19,6 +19,11 @@
#ifdef LERMEN_STUFF
#define LVERSION "L3"
#endif
+#define ANSI_BOLD "\033[1m"
+#define ANSI_UNDERLINE "\033[4m"
+#define ANSI_RED_BG "\033[41m"
+#define ANSI_GREEN_BG "\033[42m"
+#define ANSI_NORMAL "\033[0m"
#include "system.h"
@@ -107,6 +112,10 @@ struct option const longopts[] =
{
{"auto-pager" , 0, NULL, 'a'},
{"avoid-wraps" , 0, NULL, 'n'},
+ {"ansi-red-green" , 0, NULL, 'A'},
+ {"bold-inserted" , 0, NULL, 'B'},
+ {"underline-deleted" , 0, NULL, 'U'},
+ {"label" , 1, NULL, 'L'},
{"copyright" , 0, NULL, 'C'},
{"end-delete" , 1, NULL, 'x'},
{"end-insert" , 1, NULL, 'z'},
@@ -142,6 +151,9 @@ int no_wrapping; /* end/restart strings
int autopager; /* if calling the pager automatically */
int overstrike; /* if using printer overstrikes */
int overstrike_for_less; /* if output aimed to the "less" program */
+int ansi_red_green; // highlight deleted text in red, added text in green
+int bold_inserted; // mark inserted text in bold
+int underline_deleted; // underline deleted text
const char *user_delete_start; /* user specified string for start of delete */
const char *user_delete_end; /* user specified string for end of delete */
const char *user_insert_start; /* user specified string for start of insert */
@@ -245,6 +257,8 @@ setup_signals (void)
#define BUFLINE_SIZE 1024
struct bufline {
struct bufline *next;
+ int left_line_no; // current line number in left file
+ int right_line_no; // current line number in right file
char line[BUFLINE_SIZE];
};
@@ -291,6 +305,8 @@ static void flush_buflines(void)
while (headbufline != tailbufline) {
if (bufline_overrun) {
fprintf(output_file, "\n%s\n", SEPARATOR_LINE);
+ fprintf(output_file, "=== %d,%d ===\n",
+ tailbufline->left_line_no, tailbufline->right_line_no);
bufline_overrun = 0;
}
fputs(tailbufline->line, output_file);
@@ -298,12 +314,17 @@ static void flush_buflines(void)
}
}
+static int left_line_number = 0;
+static int right_line_number = 0;
+
static inline void save_char(int c)
{
headbufline->line[bufcols++] = c;
if (c == '\n') {
headbufline->line[bufcols] = 0;
inc_headbuf();
+ headbufline->left_line_no = left_line_number;
+ headbufline->right_line_no = right_line_number;
bufcols = 0;
}
}
@@ -311,6 +332,9 @@ static inline void save_char(int c)
static inline int our_putc(int c, FILE *stream)
{
if (context_lines && stream == output_file) {
+ if ((c == '\n') && (in_emphasize < 2)) right_line_number++;
+ if ((c == '\n') && (in_emphasize != 1)) left_line_number++;
+
if (!in_emphasize) {
if (behind_emphasize) {
if (c == '\n') behind_emphasize--;
@@ -335,7 +359,7 @@ static void real_end_of_insert (void);
static void our_start_of_delete (void)
{
if (context_lines) flush_buflines();
- in_emphasize = 1;
+ in_emphasize = 2;
real_start_of_delete();
}
static void our_end_of_delete (void)
@@ -466,7 +490,11 @@ real_start_of_delete (void)
tputs (term_delete_start, 0, putc_for_tputs);
#endif
if (user_delete_start)
- fprintf (output_file, "%s", user_delete_start);
+ {
+ fprintf (output_file, "%s", user_delete_start);
+ if (underline_deleted) fputs (ANSI_UNDERLINE, output_file);
+ if (ansi_red_green) fputs (ANSI_RED_BG, output_file);
+ }
}
/*-------------------------.
@@ -483,7 +511,10 @@ real_end_of_delete (void)
return;
if (user_delete_end)
- fprintf (output_file, "%s", user_delete_end);
+ {
+ if (ansi_red_green || underline_deleted) fputs (ANSI_NORMAL, output_file);
+ fprintf (output_file, "%s", user_delete_end);
+ }
#if HAVE_TPUTS
if (term_delete_end)
tputs (term_delete_end, 0, putc_for_tputs);
@@ -510,7 +541,12 @@ real_start_of_insert (void)
tputs (term_insert_start, 0, putc_for_tputs);
#endif
if (user_insert_start)
- fprintf (output_file, "%s", user_insert_start);
+ {
+ fprintf (output_file, "%s", user_insert_start);
+ if (bold_inserted) fputs (ANSI_BOLD, output_file);
+ if (ansi_red_green) fputs (ANSI_GREEN_BG, output_file);
+ }
+
}
/*-------------------------.
@@ -527,7 +563,10 @@ real_end_of_insert (void)
return;
if (user_insert_end)
- fprintf (output_file, "%s", user_insert_end);
+ {
+ if (bold_inserted || ansi_red_green) fputs (ANSI_NORMAL, output_file);
+ fprintf (output_file, "%s", user_insert_end);
+ }
#if HAVE_TPUTS
if (term_insert_end)
tputs (term_insert_end, 0, putc_for_tputs);
@@ -599,7 +638,10 @@ copy_whitespace (SIDE *side, FILE *file)
if (side->character == '\n')
{
if (no_wrapping && user_delete_end)
- fprintf (output_file, "%s", user_delete_end);
+ {
+ if (ansi_red_green || underline_deleted) fputs (ANSI_NORMAL, output_file);
+ fprintf (output_file, "%s", user_delete_end);
+ }
#if HAVE_TPUTS
if (term_delete_end)
tputs (term_delete_end, 0, putc_for_tputs);
@@ -610,7 +652,11 @@ copy_whitespace (SIDE *side, FILE *file)
tputs (term_delete_start, 0, putc_for_tputs);
#endif
if (no_wrapping && user_delete_start)
- fprintf (output_file, "%s", user_delete_start);
+ {
+ fprintf (output_file, "%s", user_delete_start);
+ if (underline_deleted) fputs (ANSI_UNDERLINE, output_file);
+ if (ansi_red_green) fputs (ANSI_RED_BG, output_file);
+ }
}
else if (overstrike_for_less)
{
@@ -626,7 +672,10 @@ copy_whitespace (SIDE *side, FILE *file)
if (side->character == '\n')
{
if (no_wrapping && user_insert_end)
- fprintf (output_file, "%s", user_insert_end);
+ {
+ if (bold_inserted || ansi_red_green) fputs (ANSI_NORMAL, output_file);
+ fprintf (output_file, "%s", user_insert_end);
+ }
#if HAVE_TPUTS
if (term_insert_end)
tputs (term_insert_end, 0, putc_for_tputs);
@@ -637,7 +686,11 @@ copy_whitespace (SIDE *side, FILE *file)
tputs (term_insert_start, 0, putc_for_tputs);
#endif
if (no_wrapping && user_insert_start)
- fprintf (output_file, "%s", user_insert_start);
+ {
+ fprintf (output_file, "%s", user_insert_start);
+ if (bold_inserted) fputs (ANSI_BOLD, output_file);
+ if (ansi_red_green) fputs (ANSI_GREEN_BG, output_file);
+ }
}
else if (overstrike_for_less)
{
@@ -1351,7 +1404,11 @@ Mandatory arguments to long options are
-3, --no-common inhibit output of common words\n"));
#ifdef LERMEN_STUFF
printf (_("\
- -c --context like -3, but print given context lines\n"));
+ -c --context=N like -3, but print N lines of context\n\
+ -A --ansi-red-green highlight deleted text in red, added text in green\n\
+ -B --bold-inserted mark inserted text in bold\n\
+ -U --underline-deleted underline deleted text\n\
+ -L --label=LABEL use LABEL insted of filename"));
#endif
printf (_("\
-a, --auto-pager automatically calls a pager\n\
@@ -1403,6 +1460,9 @@ main (int argc, char *const argv[])
autopager = 0;
overstrike = 0;
overstrike_for_less = 0;
+ ansi_red_green = 0;
+ bold_inserted = 0;
+ underline_deleted = 0;
user_delete_start = NULL;
user_delete_end = NULL;
user_insert_start = NULL;
@@ -1423,7 +1483,7 @@ main (int argc, char *const argv[])
count_changed_right = 0;
while (option_char = getopt_long (argc, (char **) argv,
- "123CKahilnpPstvw:x:y:z:c:", longopts, NULL),
+ "123ABUCKahilnpPstvw:x:y:z:c:L:", longopts, NULL),
option_char != EOF)
switch (option_char)
{
@@ -1439,6 +1499,18 @@ main (int argc, char *const argv[])
inhibit_common = 1;
break;
+ case 'U':
+ underline_deleted = 1;
+ break;
+
+ case 'B':
+ bold_inserted = 1;
+ break;
+
+ case 'A':
+ ansi_red_green = 1;
+ break;
+
case 'C':
print_copyright ();
exit (EXIT_SUCCESS);
@@ -1508,10 +1579,16 @@ warranty; not even for MERCHANTABILITY o
stdout);
fputs (_("\
\n\
-Written by Franc,ois Pinard .\n"),
+Written by Franc,ois Pinard .\n\
+Patches by Hans Lermen (1994), Juergen Weigert \n"),
stdout);
exit (EXIT_SUCCESS);
+ case 'L':
+ // just here for compat with diff. Not really implemented.
+ // user_label = optarg;
+ break;
+
case 'w':
user_delete_start = optarg;
break;
++++++ wdiff-0.5.2-diff.patch -> wdiff-0.5.93-diff.patch ++++++
--- wdiff/wdiff-0.5.2-diff.patch 2004-04-02 14:46:36.000000000 +0200
+++ wdiff/wdiff-0.5.93-diff.patch 2009-08-03 23:30:31.000000000 +0200
@@ -1,6 +1,6 @@
---- src/wdiff.c
-+++ src/wdiff.c
-@@ -1047,10 +1047,10 @@
+--- wdiff-0.5.93/src/wdiff.c.orig 2008-06-20 21:34:40.000000000 +0200
++++ wdiff-0.5.93/src/wdiff.c 2009-08-03 21:20:25.673199000 +0200
+@@ -952,10 +952,10 @@ launch_input_program (void)
/* Launch the diff program. */
if (ignore_case)
@@ -12,4 +12,4 @@
+ input_file = readpipe (DIFF_PROGRAM, "--normal", left_side->temp_name,
right_side->temp_name, NULL);
if (!input_file)
- error (EXIT_OTHER_REASON, errno, DIFF_PROGRAM);
+ error (EXIT_FAILURE, errno, "%s", DIFF_PROGRAM);
++++++ wdiff-0.5.93-lermen.patch ++++++
++++ 706 lines (skipped)
++++++ wdiff-0.5.2.tar.bz2 -> wdiff-0.5.93.tar.bz2 ++++++
++++ 117069 lines of diff (skipped)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org