X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fregex%2Fregcomp.c;h=399989e7905b8a23ce53ad74cef49bc4c94710d6;hb=743546a9339d3da4304fd63f74872e90ac792f63;hp=ea6e6a6942ab7a7d9af5871153b1f8003233cfe6;hpb=952700e8c32f7e81045cd01e1ecb3f7ca3f4c762;p=musl diff --git a/src/regex/regcomp.c b/src/regex/regcomp.c index ea6e6a69..399989e7 100644 --- a/src/regex/regcomp.c +++ b/src/regex/regcomp.c @@ -1052,8 +1052,6 @@ tre_parse(tre_parse_ctx_t *ctx) } case PARSE_UNION: - if (!*ctx->re) - break; switch (*ctx->re) { case CHAR_PIPE: @@ -1086,8 +1084,6 @@ tre_parse(tre_parse_ctx_t *ctx) case PARSE_POSTFIX: /* Parse postfix operators. */ - if (!*ctx->re) - break; switch (*ctx->re) { case CHAR_PLUS: @@ -1353,6 +1349,8 @@ tre_parse(tre_parse_ctx_t *ctx) if (ctx->cflags & REG_EXTENDED || ctx->re == ctx->re_start) { + if (!(ctx->cflags & REG_EXTENDED)) + STACK_PUSHX(stack, int, PARSE_CATENATION); result = tre_ast_new_literal(ctx->mem, ASSERTION, ASSERT_AT_BOL, -1); if (result == NULL) @@ -3093,7 +3091,7 @@ tre_ast_to_tnfa(tre_ast_node_t *node, tre_tnfa_transition_t *transitions, int -regcomp(regex_t *preg, const char *regex, int cflags) +regcomp(regex_t *restrict preg, const char *restrict regex, int cflags) { tre_stack_t *stack; tre_ast_node_t *tree, *tmp_ast_l, *tmp_ast_r;