Thread View: gnu.utils.bug
1 messages
1 total messages
Started by Matthias Ulrich Neeracher
Thu, 07 Jan 1993 00:52
Suspected bug with diff --side-by-side
Author: Matthias Ulrich Neeracher
Date: Thu, 07 Jan 1993 00:52
Date: Thu, 07 Jan 1993 00:52
48 lines
1735 bytes
1735 bytes
Hello,
while porting GNU diff 2.0 to a Machine Whose Name I Shall Not Mention,
I noticed that diff when called with the --side-by-side option sometimes
would misalign long lines containing tabs. I managed to track it down
to the following lines; when the lines marked with "+" are added, the
problem goes away. The justification for this patch is that otherwise
in_position is updated, while out_position is not *and may still be smaller
than out_bound*.
*** oldside.c Wed Jan 6 23:39:40 1993
--- side.c Wed Jan 6 23:39:25 1993
***************
*** 96,115 ****
--- 96,121 ----
{
out_position++;
putc (' ', out);
}
else
if (out_position + spaces < out_bound)
{
out_position += spaces;
putc (c, out);
}
+ else
+ while (out_position < out_bound && spaces--)
+ {
+ out_position++;
+ putc (' ', out);
+ }
}
break;
case '\r':
{
putc (c, out);
tab_from_to (0, indent);
in_position = out_position = 0;
}
break;
Matthias
-----
Matthias Neeracher neeri@iis.ethz.ch
"These days, though, you have to be pretty technical before you can
even aspire to crudeness." -- William Gibson, _Johnny Mnemonic_
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads