diff options
Diffstat (limited to 'httpd/patterns.c')
-rw-r--r-- | httpd/patterns.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/httpd/patterns.c b/httpd/patterns.c index 62c8078..08c1e27 100644 --- a/httpd/patterns.c +++ b/httpd/patterns.c @@ -429,13 +429,12 @@ match(struct match_state *ms, const char *s, const char *p) if (ms->repetitioncounter-- == 0) { match_error(ms, "max repetition items"); s = NULL; /* fail */ - } else - /* accept empty? */ - if (*ep == '*' || *ep == '?' || *ep == '-') { - p = ep + 1; + } else if + (*ep == '*' || *ep == '?' || *ep == '-') { + p = ep + 1; /* return match(ms, s, ep + 1); */ - goto init; + goto init; } else { /* '+' or no suffix */ s = NULL; /* fail */ @@ -628,11 +627,13 @@ str_find_aux(struct match_state *ms, const char *pattern, const char *string, do { const char *res; ms->level = 0; - assert(ms->matchdepth == MAXCCALLS); if ((res = match(ms, s1, p)) != NULL) { sm->sm_so = 0; sm->sm_eo = ls; return push_captures(ms, s1, res, sm + 1, nsm - 1) + 1; + + } else if (ms->error != NULL) { + return 0; } } while (s1++ < ms->src_end && !anchor); |