commit 2e4cf67fafc78b885366b8fde3d9e0c80f35f871 Author: Russ Cox Date: Thu Sep 30 08:44:00 2021 -0400 sam: fix spurious overwrite message Fixes: % sam -d -. w foo foo: (new file) #0 w foo ?warning: write might change good version of `foo' [signed-off ok by cross@ for Harvey. Merge from plan9port, which is MIT] Signed-off-by: Dan Cross diff --git a/sys/src/cmd/sam/io.c b/sys/src/cmd/sam/io.c index 3fee95a05..f24389790 100644 --- a/sys/src/cmd/sam/io.c +++ b/sys/src/cmd/sam/io.c @@ -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;