shithub: vdiff

Download patch

ref: 10fe2e4f3fbe370a9b42624ee979999305a0d19d
parent: bdcb6b9bd4a9df6338370570fd0b6a5148459911
author: phil9 <telephil9@gmail.com>
date: Sun Dec 5 05:10:30 EST 2021

fix relative path plumbing (thanks qwx)

--- a/vdiff.c
+++ b/vdiff.c
@@ -265,8 +265,11 @@
 			ab = 1;
 		if(l->t == Lfile && l->s[0] == '+'){
 			f = l->s+4;
-			if(ab && strncmp(f, "b/", 2)==0)
+			if(ab && strncmp(f, "b/", 2)==0){
 				f += 1;
+				if(access(f, AEXIST) < 0)
+					f += 1;
+			}
 			t = strchr(f, '\t');
 			if(t!=nil)
 				*t = 0;