bug in UCB Pascal compiler

stan.rice%rand-relay at sri-unix.UUCP stan.rice%rand-relay at sri-unix.UUCP
Wed Oct 26 15:57:21 AEST 1983


From:  Stan Hanks <stan.rice at rand-relay>

Greetings Pascal Lovers everywhere. (well, maybe even Pascal
tolerators. whatever). We have been using UCB Pascal on our 750's
running 4.1 in all of the lower level Computer Science courses here at
Rice for about a year and a half now with only minor complaints. One of
the largest of these has been the annoying tendency to run out of space
in the /tmp partition as the due date for any given lab assignment
grows near. This is due entirely to the vast proliferation of /tmp/pc*
files left hanging about by the compiler. If you also have been plagued
with this, READ ON. If not, the rest of this message may not interest
you.

In /usr/src/cmd/pascal/pc.c, you will find a routine named remove. This
guy's sole purpose in life is to flush the useless /tmp files after the
compilation has terminated. You will note that the code looks like:

	if (tfile[0])
		unlink(tfile[0];
	if (tfile[1])
		unlink(tfile[1]);

This is real peachy except for the fact that tfile is a file descriptor
returned by creat, instead of a (char *) that is in fact the name of
the file. The correct code should be:

	if (tfile[0])
		unlink(tname[0];
	if (tfile[1])
		unlink(tname[1]);

This will do the trick just fine. Hope this makes other folks as happy
as it made me!


				Stan Hanks
				Department of Computer Science
				Rice University
				Houston TX
				
				stan.rice at rand-relay   (arpanet)
				stan at rice              (csnet)
				...!lbl-csam!rice!stan (uucp)



More information about the Comp.unix.wizards mailing list