- if (strncmp(pattern,"- ",2) == 0) {
- pattern += 2;
- } else if (strncmp(pattern,"+ ",2) == 0) {
- ret->include = 1;
- pattern += 2;
- } else {
- ret->include = include;
+ if (exclude_path_prefix)
+ mflags |= MATCHFLG_ABS_PATH;
+ if (exclude_path_prefix && *pat == '/')
+ ex_len = strlen(exclude_path_prefix);
+ else
+ ex_len = 0;
+ ret->pattern = new_array(char, ex_len + pat_len + 1);
+ if (!ret->pattern)
+ out_of_memory("make_exclude");
+ if (ex_len)
+ memcpy(ret->pattern, exclude_path_prefix, ex_len);
+ strlcpy(ret->pattern + ex_len, pat, pat_len + 1);
+ pat_len += ex_len;
+
+ if (strpbrk(ret->pattern, "*[?")) {
+ mflags |= MATCHFLG_WILD;
+ if ((cp = strstr(ret->pattern, "**")) != NULL) {
+ mflags |= MATCHFLG_WILD2;
+ /* If the pattern starts with **, note that. */
+ if (cp == ret->pattern)
+ mflags |= MATCHFLG_WILD2_PREFIX;
+ }