From d3ee9f70e4ee00bd12557910c9e3dcc1fabd53c7 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Thu, 30 Sep 2021 08:44:00 -0400 Subject: [PATCH] sam: fix spurious overwrite message Fixes: % sam -d -. w foo foo: (new file) #0 w foo ?warning: write might change good version of `foo' --- src/cmd/sam/io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/sam/io.c b/src/cmd/sam/io.c index c112c0a1..c3dc9778 100644 --- a/src/cmd/sam/io.c +++ b/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;