sam: fix spurious overwrite message

Fixes:

% sam -d
 -.
w foo
foo: (new file) #0
w foo
?warning: write might change good version of `foo'
This commit is contained in:
Russ Cox 2021-09-30 08:44:00 -04:00
parent 8cf52696be
commit d3ee9f70e4

View file

@ -63,7 +63,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;