@matheusbsbs / matheus-bagliano / commits / 6e17886d37
Fork 0

git-mv: fix off-by-one error

Embarassing. Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>

Johannes Schindelin committed Aug 21, 2006 at 22:22 UTC 6e17886d376ee8480cc9a8b9bc5046f2d721565f
1 file changed +1 -1
builtin-mv.c
+1 -1
@@ -26,7 +26,7 @@ static const char **copy_pathspec(const char *prefix, const char **pathspec,
26 if (length > 0 && result[i][length - 1] == '/') {
27 char *without_slash = xmalloc(length);
28 memcpy(without_slash, result[i], length - 1);
29 - without_slash[length] = '\0';
29 + without_slash[length - 1] = '\0';
30 result[i] = without_slash;
31 }
32 if (base_name) {