if((s->argc > 1) && !strcmp(s->argv[1], "directory"))
pat->type = PT_DIR;
+ else if((s->argc > 1) && !strcmp(s->argv[1], "notfound"))
+ pat->type = PT_NOTFOUND;
+ else
+ pat->type = PT_FILE;
sl = s->lno;
while(1) {
getcfline(s);
if(cf->capture != NULL)
free(cf->capture);
cf->capture = sstrdup(s->argv[1]);
+ cf->caproot = 0;
+ if((s->argc > 2) && strchr(s->argv[2], 'D'))
+ cf->caproot = 1;
} else if(!strcmp(s->argv[0], "eof")) {
break;
} else {
return(NULL);
}
-struct pattern *findmatch(char *file, int trydefault, int dir)
+struct pattern *findmatch(char *file, int trydefault, int type)
{
int i, o, c;
char *bn, *ln;
ln = file; /* This should only happen in the base directory. */
}
for(pat = cfs[c]->patterns; pat != NULL; pat = pat->next) {
- if(!dir && (pat->type == PT_DIR))
- continue;
- if(dir && (pat->type != PT_DIR))
+ if(pat->type != type)
continue;
for(i = 0; (rule = pat->rules[i]) != NULL; i++) {
if(rule->type == PAT_BASENAME) {
}
}
if(!trydefault)
- return(findmatch(file, 1, dir));
+ return(findmatch(file, 1, type));
return(NULL);
}