🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.utils.bug
Article #1552

2 diff bugs, 1 (trivial) fix

#1552
From: Brian Matthews
Date: Tue, 11 Apr 1989 17:23
46 lines
1621 bytes
I've compiled the latest gnu diff from osu-cis (version 1.4, as of 26 Oct
1988), and found a couple of problems.  I compiled it with gcc 1.34 on a
System V Release 3 machine.

First, in diff3.c on line 112, there is an #ifdef _GNUCC, which needs to
be #ifdef __GNUC__ (for 1.34 gcc at least).  Although it hardly seems
worth it, a context diff is attached below.

Secondly, when a blank line is added at the beginning and end of a file,
a normal diff misses the one added at the end.  So, you get something
like the following:

$ echo 'Hello, earth' >file1
$ echo '\nHello, earth\n' >file2
$ ./diff file1 file2
0a1
> 
$ 

A diff -c works as expected.  Has anyone else seen this?  Anyone fixed
it?

As promised, the context diff for diff3.c:

*** orig/diff3.c	Mon Apr 10 14:41:11 1989
--- diff3.c	Mon Apr 10 14:41:24 1989
***************
*** 109,115 ****
  #include <ctype.h>
  #include "diff.h"
  
! #ifdef _GNUCC
  #define alloca __builtin_alloca
  #endif
  
--- 109,115 ----
  #include <ctype.h>
  #include "diff.h"
  
! #ifdef __GNUC__
  #define alloca __builtin_alloca
  #endif
  
-- 
Brian L. Matthews  blm@cxsea.UUCP   ...{mnetor,uw-beaver!ssc-vax}!cxsea!blm
+1 206 251 6098    Computer X Inc. - a division of Motorola New Enterprises
Technical Details
Message-ID: <2659@cxsea.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!rutgers!mcdchg!cxhq!cxsea!blm

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!rutgers!mcdchg!cxhq!cxsea!blm
From: blm@cxsea.UUCP (Brian Matthews)
Newsgroups: gnu.utils.bug
Subject: 2 diff bugs, 1 (trivial) fix
Message-ID: <2659@cxsea.UUCP>
Date: 11 Apr 89 17:23:40 GMT
Reply-To: blm@cxsea.UUCP (Brian Matthews)
Organization: Computer X Inc.
Lines: 46