+
+/* Return nonzero if file NAME is excluded. Exclude a name if its
+ prefix matches a pattern that contains slashes, or if one of its
+ components matches a pattern that contains no slashes. */
+int
+excluded_name (char const *name)
+{
+ char const *p;
+ name += FILESYSTEM_PREFIX_LEN (name);
+
+ if (excluded_filename (excluded_with_slash, name,
+ FNM_FILE_NAME | FNM_LEADING_DIR))
+ return 1;
+
+ for (p = name; *p; p++)
+ if ((p == name || (ISSLASH (p[-1]) && !ISSLASH (p[0])))
+ && excluded_filename (excluded_without_slash, p,
+ FNM_FILE_NAME | FNM_LEADING_DIR))
+ return 1;
+
+ return 0;
+}