summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/diff/side.c
diff options
context:
space:
mode:
authorjtc <jtc@NetBSD.org>1993-09-16 17:39:00 +0000
committerjtc <jtc@NetBSD.org>1993-09-16 17:39:00 +0000
commit69a25a6a71efcadf0db55504379e7a74cecf54ca (patch)
tree70d25a47e8da160d611afa43ef8986aa2bbe62fa /gnu/usr.bin/diff/side.c
parent941b6d7b199d8c66a499f0baea38c26e5882e3c6 (diff)
Updated to GNU Diffutils 2.4.
Diffstat (limited to 'gnu/usr.bin/diff/side.c')
-rw-r--r--gnu/usr.bin/diff/side.c43
1 files changed, 22 insertions, 21 deletions
diff --git a/gnu/usr.bin/diff/side.c b/gnu/usr.bin/diff/side.c
index 106cb94817b..ce695dafe6b 100644
--- a/gnu/usr.bin/diff/side.c
+++ b/gnu/usr.bin/diff/side.c
@@ -19,15 +19,16 @@ file named COPYING. Among other things, the copyright notice
and this notice must be preserved on all copies. */
#ifndef lint
-static char rcsid[] = "$Id: side.c,v 1.2 1993/08/02 17:26:28 mycroft Exp $";
-#endif /* not lint */
+static char *rcsid = "$Id: side.c,v 1.3 1993/09/16 17:39:29 jtc Exp $";
+#endif
#include "diff.h"
-
-static void print_sdiff_hunk ();
-static void print_sdiff_common_lines ();
-static void print_1sdiff_line ();
+static unsigned print_half_line PARAMS((char const * const *, unsigned, unsigned));
+static unsigned tab_from_to PARAMS((unsigned, unsigned));
+static void print_1sdiff_line PARAMS((char const * const *, int, char const * const *));
+static void print_sdiff_common_lines PARAMS((int, int));
+static void print_sdiff_hunk PARAMS((struct change *));
/* Next line number to be printed in the two input files. */
static int next0, next1;
@@ -73,12 +74,12 @@ tab_from_to (from, to)
*/
static unsigned
print_half_line (line, indent, out_bound)
- const char * const *line;
+ char const * const *line;
unsigned indent, out_bound;
{
FILE *out = outfile;
register unsigned in_position = 0, out_position = 0;
- register const char
+ register char const
*text_pointer = line[0],
*text_limit = line[1];
@@ -135,21 +136,21 @@ print_half_line (line, indent, out_bound)
case '\f':
case '\v':
+ control_char:
if (in_position < out_bound)
putc (c, out);
break;
default:
- {
- register unsigned p = in_position;
- if (textchar[c])
- in_position++;
- if (p < out_bound)
- {
- out_position = in_position;
- putc (c, out);
- }
- }
+ if (! isgraph (c))
+ goto control_char;
+ /* falls through */
+ case ' ':
+ if (in_position++ < out_bound)
+ {
+ out_position = in_position;
+ putc (c, out);
+ }
break;
case '\n':
@@ -162,15 +163,15 @@ print_half_line (line, indent, out_bound)
/*
* Print side by side lines with a separator in the middle.
- * NULL parameters are taken to indicate whitespace text.
+ * 0 parameters are taken to indicate white space text.
* Blank lines that can easily be caught are reduced to a single newline.
*/
static void
print_1sdiff_line (left, sep, right)
- const char * const *left;
+ char const * const *left;
int sep;
- const char * const *right;
+ char const * const *right;
{
FILE *out = outfile;
unsigned hw = sdiff_half_width, c2o = sdiff_column2_offset;