From owner-freebsd-current Sat Feb 7 17:39:17 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id RAA07486 for current-outgoing; Sat, 7 Feb 1998 17:39:17 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from taliesin.cs.ucla.edu (Taliesin.CS.UCLA.EDU [131.179.96.166]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id RAA07481 for ; Sat, 7 Feb 1998 17:39:15 -0800 (PST) (envelope-from scottm@mordred.cs.ucla.edu) Received: (qmail 4638 invoked from network); 8 Feb 1998 01:39:12 -0000 Received: from mordred.cs.ucla.edu (131.179.48.34) by taliesin.cs.ucla.edu with SMTP; 8 Feb 1998 01:39:12 -0000 Received: from mordred.cs.ucla.edu (localhost [127.0.0.1]) by mordred.cs.ucla.edu (8.8.8/8.8.8) with ESMTP id RAA00299; Sat, 7 Feb 1998 17:39:12 -0800 (PST) (envelope-from scottm@mordred.cs.ucla.edu) Message-Id: <199802080139.RAA00299@mordred.cs.ucla.edu> X-Mailer: exmh version 2.0.1 12/23/97 To: John Polstra cc: scottm@CS.UCLA.EDU, current@FreeBSD.ORG Subject: Re: cvs bug (and fix) In-reply-to: Your message of "Sat, 07 Feb 1998 11:21:24 PST." <199802071921.LAA18068@austin.polstra.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 07 Feb 1998 17:39:11 -0800 From: Scott Michel Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG X-To-Unsubscribe: mail to majordomo@FreeBSD.org "unsubscribe current" > In article <199802062246.OAA03856@mordred.cs.ucla.edu>, > Scott Michel 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