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>
This commit is contained in:
Johannes Schindelin 2009-04-20 19:44:53 +02:00 committed by Junio C Hamano
parent 1f9b620fdb
commit 7183c09d11

1
tree.c
View File

@ -62,6 +62,7 @@ static int match_tree_entry(const char *base, int baselen, const char *path, uns
continue;
/* pathspecs match only at the directory boundaries */
if (!matchlen ||
baselen == matchlen ||
base[matchlen] == '/' ||
match[matchlen - 1] == '/')
return 1;