git: 9front

Download patch

ref: 32762a4ddb5fdda7b5b5ed128ac5cc605f8e7d30
parent: be46096f52f36694318e231e7f8504b7bef84ca0
author: Igor Böhm <igor@9lab.org>
date: Tue Oct 5 05:27:45 EDT 2021

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'

--- a/sys/src/cmd/sam/io.c
+++ b/sys/src/cmd/sam/io.c
@@ -66,7 +66,7 @@
 		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;
--