mirror of
https://github.com/fluencelabs/musl
synced 2025-06-26 21:22:11 +00:00
fix regex breakage in last commit (failure to handle empty regex, etc.)
This commit is contained in:
@ -1149,10 +1149,6 @@ tre_parse(tre_parse_ctx_t *ctx)
|
|||||||
an empty set of `()', a bracket expression, `.', `^', `$',
|
an empty set of `()', a bracket expression, `.', `^', `$',
|
||||||
a `\' followed by a character, or a single character. */
|
a `\' followed by a character, or a single character. */
|
||||||
|
|
||||||
/* End of regexp? (empty string). */
|
|
||||||
if (!*ctx->re)
|
|
||||||
goto parse_literal;
|
|
||||||
|
|
||||||
switch (*ctx->re)
|
switch (*ctx->re)
|
||||||
{
|
{
|
||||||
case CHAR_LPAREN: /* parenthesized subexpression */
|
case CHAR_LPAREN: /* parenthesized subexpression */
|
||||||
@ -1394,6 +1390,7 @@ tre_parse(tre_parse_ctx_t *ctx)
|
|||||||
if (!(ctx->cflags & REG_EXTENDED))
|
if (!(ctx->cflags & REG_EXTENDED))
|
||||||
goto parse_literal;
|
goto parse_literal;
|
||||||
|
|
||||||
|
case 0:
|
||||||
empty_atom:
|
empty_atom:
|
||||||
result = tre_ast_new_literal(ctx->mem, EMPTY, -1, -1);
|
result = tre_ast_new_literal(ctx->mem, EMPTY, -1, -1);
|
||||||
if (!result)
|
if (!result)
|
||||||
|
Reference in New Issue
Block a user