SCCS oddity
Chris Miller
chris at hwcs.UUCP
Tue Nov 6 03:11:40 AEST 1984
In the course of installing the user-contributed program "bib" on
4.2bsd, I found a most puzzling bug. "Bib", like "refer", uses an
inverted index giving a file, character offset and length for each
instance of a keyword. All offsets and lengths were being created as 0
by "invert", the inversion program.
Investigation revealed that an intermediate file was being scanned for
keyword entries by
sscanf(line,"%s%s83/03/29D", key, file, &start, &length);
(I'm not sure whether the embedded date is exactly right!). From this,
it is immediately obvious :-) that the file was originally maintained
using SCCS, and that the authors had originally written
sscanf(line,"%s%s%D%D", key, file, &start, &length);
The %D% was then translated by SCCS to the current date!
I am not sure which is more irritating: that a piece of distributed
(albeit "unsupported") software goes out containing a trivial bug which
breaks it completely, or that a standard tool like SCCS has been
designed so as to be able to break a perfectly reasonable piece of
code. (Yes, I know that there are ways around the problem).
Addendum:
My investigation of "bib" was sparked off by discovering that "addbib"
is also completely (but trivially) broken in the 4.2bsd release, since
it fails to clear the EOF condition after reading an abstract, and
subsequently goes into an infinite read-prompt loop. Sometimes (very
rarely) words fail me.
--
Chris Miller
Department of Computer Science
Heriot-Watt University
...!ukc!{edcaad,west44}!hwcs
More information about the Comp.unix.wizards
mailing list