+ }
+ if (!slash)
+ slash = match; /* toplevel */
+ else
+ slash++;
+ if (namelen <= slash - match) {
+ /* Looking at "Documentation/" and
+ * the pattern says "Documentation/howto/", or
+ * "Documentation/diff*.txt".
+ */
+ if (!memcmp(match, name, namelen))
+ return 1;
+ }
+ else {
+ /* Looking at "Documentation/howto/" and
+ * the pattern says "Documentation/h*".
+ */
+ if (!memcmp(match, name, slash - match))
+ return 1;
+ }