| 470 | |
| 471 | |
| 472 | static int singlematch (MatchState *ms, const char *s, const char *p, |
| 473 | const char *ep) { |
| 474 | if (s >= ms->src_end) |
| 475 | return 0; |
| 476 | else { |
| 477 | int c = cast_uchar(*s); |
| 478 | switch (*p) { |
| 479 | case '.': return 1; /* matches any char */ |
| 480 | case L_ESC: return match_class(c, cast_uchar(*(p+1))); |
| 481 | case '[': return matchbracketclass(c, p, ep-1); |
| 482 | default: return (cast_uchar(*p) == c); |
| 483 | } |
| 484 | } |
| 485 | } |
| 486 | |
| 487 | |
| 488 | static const char *matchbalance (MatchState *ms, const char *s, |
no test coverage detected