sam: putenv("%", ...): don't crash when no file is current
This commit is contained in:
parent
d8b4f95476
commit
ab3492f05e
1 changed files with 1 additions and 1 deletions
|
@ -93,7 +93,7 @@ plan9(File *f, int type, String *s, int nest)
|
|||
close(0); /* so it won't read from terminal */
|
||||
open("/dev/null", 0);
|
||||
}
|
||||
putenv("%", Strtoc(&f->name));
|
||||
putenv("%", f == nil ? "" : Strtoc(&f->name));
|
||||
execl(SHPATH, SH, "-c", Strtoc(&plan9cmd), nil);
|
||||
exits("exec");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue