return 1;
}
+// Returns true if s contains globbing characters
+static int is_glob(const char* s) {
+ if (strchr(s, '*'))
+ return 1;
+
+ if (strchr(s, '?'))
+ return 1;
+
+ return 0;
+}
+
static int pakfire_filelist_is_included(const char* path, const char** includes) {
// If the includes list is empty, everything is included
if (!includes)
if (strcmp(*include, "/") == 0)
return 1;
+ // Match any subdirectories
+ if (pakfire_string_startswith(path, *include))
+ return 1;
+
+ // Skip fnmatch if the pattern doesn't have any globbing characters
+ if (!is_glob(*include))
+ continue;
+
r = fnmatch(*include, path, 0);
// Found a match