From a73f41bf4ee5fbee20391922ed56c0310e3ccae9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20B=C3=B6hm?= Date: Tue, 5 Oct 2021 09:27:45 +0000 Subject: [PATCH] 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' --- sys/src/cmd/sam/io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/src/cmd/sam/io.c b/sys/src/cmd/sam/io.c index f995bb7c9..a8ff31c31 100644 --- a/sys/src/cmd/sam/io.c +++ b/sys/src/cmd/sam/io.c @@ -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;