+ if (match_func((char *)fo->wild.get(k), ff->fname, fnmode|fnm_flags) == 0) {
+ if (ff->flags & FO_EXCLUDE) {
+ Dmsg2(100, "Exclude wild: %s file=%s\n", (char *)fo->wild.get(k),
+ ff->fname);
+ return false; /* reject file */
+ }
+ return true; /* accept file */
+ }
+ }
+ if (S_ISDIR(ff->statp.st_mode)) {
+ for (k=0; k<fo->regexdir.size(); k++) {
+ const int nmatch = 30;
+ regmatch_t pmatch[nmatch];
+ if (regexec((regex_t *)fo->regexdir.get(k), ff->fname, nmatch, pmatch, 0) == 0) {
+ if (ff->flags & FO_EXCLUDE) {
+ return false; /* reject file */
+ }
+ return true; /* accept file */
+ }
+ }
+ } else {
+ for (k=0; k<fo->regexfile.size(); k++) {
+ const int nmatch = 30;
+ regmatch_t pmatch[nmatch];
+ if (regexec((regex_t *)fo->regexfile.get(k), ff->fname, nmatch, pmatch, 0) == 0) {
+ if (ff->flags & FO_EXCLUDE) {
+ return false; /* reject file */
+ }
+ return true; /* accept file */
+ }
+ }
+ }
+ for (k=0; k<fo->regex.size(); k++) {
+ const int nmatch = 30;
+ regmatch_t pmatch[nmatch];
+ if (regexec((regex_t *)fo->regex.get(k), ff->fname, nmatch, pmatch, 0) == 0) {
+ if (ff->flags & FO_EXCLUDE) {
+ return false; /* reject file */
+ }
+ return true; /* accept file */
+ }
+ }
+ /*
+ * If we have an empty Options clause with exclude, then
+ * exclude the file
+ */
+ if (ff->flags & FO_EXCLUDE &&
+ fo->regex.size() == 0 && fo->wild.size() == 0 &&
+ fo->regexdir.size() == 0 && fo->wilddir.size() == 0 &&
+ fo->regexfile.size() == 0 && fo->wildfile.size() == 0 &&
+ fo->wildbase.size() == 0) {
+ return false; /* reject file */