Error in improved pwd
Roger Southwick
rogers at dadla.UUCP
Tue Dec 13 08:11:20 AEST 1983
If any of you picked up the "improved" pwd sent
over the net a few months back by Fred Blonder <fred at umcp-cs>,
I discovered a little bug in the program. By cd'ing into
slash (cd /), then invoking pwd, yielded a blank line.
The cure is to change the code in prname()
FROM:
prname()
{
printf("%s\n", np);
exit(0);
}
TO:
prname()
{
if(*np == '\0';)
printf("/\n");
else
printf("%s\n", np);
exit(0);
}
-Roger Southwick
tektronix!rogers
More information about the Comp.unix.wizards
mailing list