Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 07 Feb 1998 17:39:11 -0800
From:      Scott Michel <scottm@CS.UCLA.EDU>
To:        John Polstra <jdp@polstra.com>
Cc:        scottm@CS.UCLA.EDU, current@FreeBSD.ORG
Subject:   Re: cvs bug (and fix) 
Message-ID:  <199802080139.RAA00299@mordred.cs.ucla.edu>
In-Reply-To: Your message of "Sat, 07 Feb 1998 11:21:24 PST." <199802071921.LAA18068@austin.polstra.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
> In article <199802062246.OAA03856@mordred.cs.ucla.edu>,
> Scott Michel  <scottm@cs.ucla.edu> wrote:
> > This one's been driving me batshit for the last couple of days. I'm
> > surprised no one else has encountered it yet.
> > 
> > Line 6016 in /usr/src/contrib/cvs/src/rcs.c needs to be changed from
> > 
> >     if (n == EOF)
> > 
> > to
> > 
> >     if (n == EOF || num == NULL)  
> > 
> > Otherwise you get spurious assert's in findnode() a little later on.
> 
> It looks like only an invalid RCS file could cause that to happen.
> (Which of course doesn't make it any less of a bug.)  Is that right?

For some reason, mine has an extra blank line at the end of the
revision file. Other than that, it's perfectly valid.

> The fix doesn't look quite right to me.  A revision number was
> expected, but something else (not EOF) was found instead.  Shouldn't
> it report an error?
> 
> How about something like this:
> 
>     if (n == EOF)
>     {
>         /* If n == EOF and num == NULL, it means we reached EOF
>            naturally.  That's fine. */
>         if (num == NULL)
>             return NULL;
>         else
>             error (1, 0, "%s: unexpected EOF", rcs->path);
>     }   
>     else if (num == NULL)
> 	error (1, 0, "%s: file contains invalid revision number", rcs->path);

No. I'd make this a warning. Otherwise, some naive Linux-wannabe who
encounters this will generate equivalent e-mail.


-scooter





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199802080139.RAA00299>