Commit 2b861d7589467734c2371c4daaab6e540857b988

nulltoken 2011-03-19T08:31:40

Add detection of incorrect usage to git__joinpath()

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/src/util.c b/src/util.c
index bfc4f7b..995daf3 100644
--- a/src/util.c
+++ b/src/util.c
@@ -223,6 +223,9 @@ void git__joinpath_n(char *buffer_out, int count, ...)
 		int len;
 
 		path = va_arg(ap, const char *);
+
+		assert((i == 0) || path != buffer_start);
+
 		if (i > 0 && *path == '/' && buffer_out > buffer_start && buffer_out[-1] == '/')
 			path++;