Fix the case where the file is not in the current directory.
Discovered by: Vladimir Kravchenko <jimson@mostcom.ru> Pointy hat to: des
This commit is contained in:
parent
8b42c60645
commit
591c337e01
@ -363,7 +363,8 @@ mf_fgets(SPACE *sp, enum e_spflag spflag)
|
||||
errx(1, "%s: name too long", fname);
|
||||
}
|
||||
len = snprintf(tmpfname, sizeof(tmpfname),
|
||||
".!%ld!%s", (long)getpid(), fname);
|
||||
"%s/.!%ld!%s", dirname(fname), (long)getpid(),
|
||||
basename(fname));
|
||||
if (len >= sizeof(tmpfname))
|
||||
errx(1, "%s: name too long", fname);
|
||||
unlink(tmpfname);
|
||||
|
Loading…
Reference in New Issue
Block a user