- } else if(state == 2) {
- if(ind) {
- if(!w[0]) {
- } else if(!strcmp(w[0], "filename")) {
- if(argc < 2) {
- flog(LOG_WARNING, "%s:%i: missing pattern for `filename' match", path, lno);
- goto next;
- }
- rule = newrule(pat);
- rule->type = PAT_BASENAME;
- rule->pattern = sstrdup(w[1]);
- } else if(!strcmp(w[0], "pathname")) {
- if(argc < 2) {
- flog(LOG_WARNING, "%s:%i: missing pattern for `pathname' match", path, lno);
- goto next;
- }
- rule = newrule(pat);
- rule->type = PAT_PATHNAME;
- rule->pattern = sstrdup(w[1]);
- } else if(!strcmp(w[0], "all")) {
- newrule(pat)->type = PAT_ALL;
- } else if(!strcmp(w[0], "default")) {
- newrule(pat)->type = PAT_DEFAULT;
- } else if(!strcmp(w[0], "handler")) {
- if(argc < 2) {
- flog(LOG_WARNING, "%s:%i: missing child name for `handler' directive", path, lno);
- goto next;
- }
- if(pat->childnm != NULL)
- free(pat->childnm);
- pat->childnm = sstrdup(w[1]);
- } else {
- flog(LOG_WARNING, "%s:%i: unknown directive %s", path, lno, w[0]);
- }
- } else {
- state = 0;
- if(pat->rules[0] == NULL) {
- flog(LOG_WARNING, "%s:%i: missing rules in match declaration", path, lno);
- freepattern(pat);
- goto retry;
- }
- if(pat->childnm == NULL) {
- flog(LOG_WARNING, "%s:%i: missing handler in match declaration", path, lno);
- freepattern(pat);
- goto retry;
- }
- pat->next = cf->patterns;
- cf->patterns = pat;
- goto retry;
+ rule = newrule(pat);
+ rule->type = PAT_PATHNAME;
+ rule->pattern = sstrdup(s->argv[1]);
+ } else if(!strcmp(s->argv[0], "all")) {
+ newrule(pat)->type = PAT_ALL;
+ } else if(!strcmp(s->argv[0], "default")) {
+ newrule(pat)->type = PAT_DEFAULT;
+ } else if(!strcmp(s->argv[0], "handler")) {
+ if(s->argc < 2) {
+ flog(LOG_WARNING, "%s:%i: missing child name for `handler' directive", s->file, s->lno);
+ continue;