home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / gnu / utils / bug / 2339 < prev    next >
Encoding:
Text File  |  1993-01-07  |  1.6 KB  |  62 lines

  1. Newsgroups: gnu.utils.bug
  2. Path: sparky!uunet!cis.ohio-state.edu!iis.ethz.ch!neeri
  3. From: neeri@iis.ethz.ch (Matthias Ulrich Neeracher)
  4. Subject: Suspected bug with diff --side-by-side
  5. Message-ID: <199301062252.AA19766@yggdrasil.ethz.ch>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: GNUs Not Usenet
  8. Distribution: gnu
  9. Date: Thu, 7 Jan 1993 00:52:21 GMT
  10. Approved: bug-gnu-utils@prep.ai.mit.edu
  11. Lines: 49
  12.  
  13. Hello,
  14.  
  15. while porting GNU diff 2.0 to a Machine Whose Name I Shall Not Mention,
  16. I noticed that diff when called with the --side-by-side option sometimes
  17. would misalign long lines containing tabs. I managed to track it down
  18. to the following lines; when the lines marked with "+" are added, the
  19. problem goes away. The justification for this patch is that otherwise
  20. in_position is updated, while out_position is not *and may still be smaller
  21. than out_bound*.
  22.  
  23. *** oldside.c    Wed Jan  6 23:39:40 1993
  24. --- side.c    Wed Jan  6 23:39:25 1993
  25. ***************
  26. *** 96,115 ****
  27. --- 96,121 ----
  28.           {
  29.             out_position++;
  30.             putc (' ', out);
  31.           }
  32.           else
  33.             if (out_position + spaces < out_bound)
  34.           {
  35.             out_position += spaces;
  36.             putc (c, out);
  37.           }
  38. +           else
  39. +             while (out_position < out_bound && spaces--)
  40. +           {
  41. +             out_position++;
  42. +             putc (' ', out);
  43. +           }
  44.         }
  45.         break;
  46.   
  47.       case '\r':
  48.         {
  49.           putc (c, out);
  50.           tab_from_to (0, indent);
  51.           in_position = out_position = 0;
  52.         }
  53.         break;
  54.  
  55. Matthias
  56.  
  57. -----
  58. Matthias Neeracher                                   neeri@iis.ethz.ch
  59.    "These days, though, you have to be pretty technical before you can 
  60.     even aspire to crudeness." -- William Gibson, _Johnny Mnemonic_
  61.  
  62.