git: 9front

Download patch

ref: 6c763c3e080811bd94b75d92e9aa7908d3321fc1
parent: 60d93bcbe4c97038ed23052c95c21f5553aca2d8
author: Ori Bernstein <ori@eigenstate.org>
date: Mon May 26 10:43:49 EDT 2025

patch: cleanname of paths

in addition to slightly cleaner errors, it makes our
guess at whether the output file is the same as the
input file slightly more reliable, leading to better
behavior around replacing the output vs erroring that
the file already exists.

--- a/sys/src/cmd/patch.c
+++ b/sys/src/cmd/patch.c
@@ -151,6 +151,8 @@
 	h->newlen = 0;
 	h->newsz = 32;
 	h->new = emalloc(h->newsz);
+	cleanname(h->oldpath);
+	cleanname(h->newpath);
 	if(strncmp(s, "@@ -", 4) != 0)
 		return -1;
 	e = s + 4;
--