index 25d2e29fa8b1dfb964b97a10898c77d8fe86ef78..5ab90af256a664366f3f92b467f52634c0df3f79 100644 (file)
--- a/tree.c
+++ b/tree.c
/* If it doesn't match, move along... */
if (strncmp(base, match, matchlen))
continue;
/* If it doesn't match, move along... */
if (strncmp(base, match, matchlen))
continue;
- /* The base is a subdirectory of a path which was specified. */
- return 1;
+ /* pathspecs match only at the directory boundaries */
+ if (!matchlen ||
+ baselen == matchlen ||
+ base[matchlen] == '/' ||
+ match[matchlen - 1] == '/')
+ return 1;
+ continue;
}
/* Does the base match? */
}
/* Does the base match? */