X-Git-Url: http://www.dolda2000.com/gitweb/?p=ashd.git;a=blobdiff_plain;f=src%2Fdirplex%2Fconf.c;h=95f643a4ab068b031bc09ea9d9b0ed28871a3598;hp=dec84b57287dba25f267c7d740864e1b303f8e87;hb=a0b6c27cdb8e49868ec70fb276b3eb963c5852dd;hpb=f2b4b0310b2992d2e3281247f138c27b3da140cc diff --git a/src/dirplex/conf.c b/src/dirplex/conf.c index dec84b5..95f643a 100644 --- a/src/dirplex/conf.c +++ b/src/dirplex/conf.c @@ -150,6 +150,10 @@ static struct pattern *parsepattern(struct cfstate *s) 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); @@ -374,7 +378,7 @@ struct child *findchild(char *file, char *name, struct config **cf) 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; @@ -399,9 +403,7 @@ struct pattern *findmatch(char *file, int trydefault, int dir) 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) { @@ -432,7 +434,7 @@ struct pattern *findmatch(char *file, int trydefault, int dir) } } if(!trydefault) - return(findmatch(file, 1, dir)); + return(findmatch(file, 1, type)); return(NULL); }