Fix off-by-one in read_tree_recursive
Found by valgrind. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>maint
parent
1f9b620fdb
commit
7183c09d11
1
tree.c
1
tree.c
|
@ -62,6 +62,7 @@ static int match_tree_entry(const char *base, int baselen, const char *path, uns
|
||||||
continue;
|
continue;
|
||||||
/* pathspecs match only at the directory boundaries */
|
/* pathspecs match only at the directory boundaries */
|
||||||
if (!matchlen ||
|
if (!matchlen ||
|
||||||
|
baselen == matchlen ||
|
||||||
base[matchlen] == '/' ||
|
base[matchlen] == '/' ||
|
||||||
match[matchlen - 1] == '/')
|
match[matchlen - 1] == '/')
|
||||||
return 1;
|
return 1;
|
||||||
|
|
Loading…
Reference in New Issue