dtree 2 of 2
Chris Hibbert
chris at grkermit.UUCP
Fri Aug 19 03:22:17 AEST 1983
I haven't seen anyone else complain about dtree not working as posted,
but It didn't when I tried to build the latest release. The problem
was simple. The program starts a pwd with output coming through a
pipe to the program. When fgets() is used to copy the output, there is
a newline in it. chdir() can't handle that, so dtree fails, unable to
change directories back to where it thinks it started. I add a line to
zero out the newline. Diffs with context follow.
*** /tmp/,RCSt1004386 Thu Aug 18 13:16:30 1983
--- /tmp/,RCSt2004386 Thu Aug 18 13:16:33 1983
***************
*** 185,190
} else if (setbuf(istr, Buf2), fgets(home, 128, istr) == NULL) {
fprintf(stderr, "dtree: EOF from %s\n", PWD);
exit(1);
}
/* Get initial Storage space */
--- 185,192 -----
} else if (setbuf(istr, Buf2), fgets(home, 128, istr) == NULL) {
fprintf(stderr, "dtree: EOF from %s\n", PWD);
exit(1);
+ } else {
+ home[strlen(home) - 1] = 0; /* don't want the ^J at the end */
}
/* Get initial Storage space */
****************************************
Hope this helps someone.
decvax!genrad!grkermit!chris
allegra!linus!genrad!grkermit!chris
harpo!eagle!mit-vax!grkermit!chris
More information about the Comp.sources.unix
mailing list