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>
diff --git a/tree.c b/tree.c
index 0d703a0..5ab90af 100644
--- a/tree.c
+++ b/tree.c
@@ -62,6 +62,7 @@
 				continue;
 			/* pathspecs match only at the directory boundaries */
 			if (!matchlen ||
+			    baselen == matchlen ||
 			    base[matchlen] == '/' ||
 			    match[matchlen - 1] == '/')
 				return 1;