sam: fix spurious overwrite message (patch from plan9port)

Fixes:

% sam -d
 -.
w /tmp/foo
/tmp/foo: (new file) #0
w /tmp/foo
?warning: write might change good version of `/tmp/foo'
This commit is contained in:
Igor Böhm 2021-10-05 09:27:45 +00:00 committed by Ori Bernstein
parent 659496081e
commit a73f41bf4e

View file

@ -66,7 +66,7 @@ writef(File *f)
warn(Wnotnewline);
closeio(n);
if(f->name.s[0]==0 || samename){
if(statfile(name, &dev, &qid, &mtime, 0, 0) > 0){
if(statfile(genc, &dev, &qid, &mtime, 0, 0) > 0){
f->dev = dev;
f->qidpath = qid;
f->mtime = mtime;