From: Johannes Schindelin Date: Mon, 20 Apr 2009 17:44:53 +0000 (+0200) Subject: Fix off-by-one in read_tree_recursive X-Git-Tag: v1.6.3-rc2~1^2~2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=7183c09d11ac4b98f1cc78f29dcbd85df5533001;p=git.git Fix off-by-one in read_tree_recursive Found by valgrind. Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- diff --git a/tree.c b/tree.c index 0d703a0c4..5ab90af25 100644 --- a/tree.c +++ b/tree.c @@ -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;