shithub: git9

Download patch

ref: a93b357580f352497c5414254341874ff0e9022d
parent: 1d937b211a7ea5d79a1282287167a0e2ab659aeb
author: Michael Forney <mforney@mforney.org>
date: Thu Jan 14 05:24:38 EST 2021

fix findrepo when repository is at /.git

--- a/util.c
+++ b/util.c
@@ -299,7 +299,7 @@
 	for(p = buf + strlen(buf); p != nil; p = strrchr(buf, '/')){
 		strcpy(p, suff);
 		if(access(buf, AEXIST) == 0){
-			*p = 0;
+			p[p == buf] = '\0';
 			return 0;
 		}
 		*p = '\0';