}
}
+/* Returns true if all names from the namelist were processed */
+bool
+names_done ()
+{
+ struct name const *cursor;
+ for (cursor = namelist; cursor; cursor = cursor->next)
+ if (cursor->regexp || (!cursor->found && !cursor->fake))
+ return false;
+ return true;
+}
+
/* Print the names of things in the namelist that were not matched. */
void
names_notfound (void)
return (char *) p;
}
\f
+/* Return the size of the prefix of FILE_NAME that is removed after
+ stripping NUM leading path name components. NUM must be
+ positive. */
+
+size_t
+stripped_prefix_len (char const *file_name, size_t num)
+{
+ char const *p = file_name + FILESYSTEM_PREFIX_LEN (file_name);
+ while (ISSLASH (*p))
+ p++;
+ while (*p)
+ {
+ bool slash = ISSLASH (*p);
+ p++;
+ if (slash)
+ {
+ if (--num == 0)
+ return p - file_name;
+ while (ISSLASH (*p))
+ p++;
+ }
+ }
+ return -1;
+}
+\f
/* Return nonzero if NAME contains ".." as a path name component. */
bool
contains_dot_dot (char const *name)