commit 21c4c72798b0bf2fb9a2761744bc41e89fc87fcc from: rsc date: Tue Aug 29 20:15:01 2006 UTC Aviod seg fault when no file commit - c7c29d26b7f9bcd735779859211bf525f007078e commit + 21c4c72798b0bf2fb9a2761744bc41e89fc87fcc blob - ba69be6e22da542cd8c57394889b86312dcbd244 blob + e86509584f8e05b691691c33a10e17b7882f4e55 --- src/cmd/sam/shell.c +++ src/cmd/sam/shell.c @@ -12,7 +12,10 @@ void setname(File *f) { char buf[1024]; - snprint(buf, sizeof buf, "%.*S", f->name.n, f->name.s); + if(f) + snprint(buf, sizeof buf, "%.*S", f->name.n, f->name.s); + else + buf[0] = 0; putenv("samfile", buf); }