ref: 0a067833bb46259232035b1d894e3b21567c4ee8
parent: 1b44273293b2d987a1f0d584ef5d9b1cefd2b44a
author: Ori Bernstein <ori@eigenstate.org>
date: Tue Jan 30 18:26:42 EST 2024
vdiff: correctly strip more than one prefix The code as committed will point to the /, and not 1 past it, which means that the next strchr will point to the same '/'; this means we both get relative paths, and never strip off past the first '/'.
--- a/sys/src/cmd/vdiff.c
+++ b/sys/src/cmd/vdiff.c
@@ -75,7 +75,7 @@
return;
for(i = 0; i < nstrip; i++)
if((p = strchr(f, '/')) != nil)
- f = p;
+ f = p+1;
getwd(wd, sizeof wd);
snprint(addr, sizeof addr, "%s:%d", f, l);
plumbsendtext(fd, "vdiff", "edit", wd, addr);
--
⑨