}
case PARSE_UNION:
- if (!*ctx->re)
- break;
switch (*ctx->re)
{
case CHAR_PIPE:
case PARSE_POSTFIX:
/* Parse postfix operators. */
- if (!*ctx->re)
- break;
switch (*ctx->re)
{
case CHAR_PLUS:
}
}
- if (!*ctx->re)
+ if (!ctx->re[1])
/* Trailing backslash. */
return REG_EESCAPE;
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)
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;