瀏覽代碼

another BRE fix: in ^*, * is literal

i don't understand why this has to be conditional on being in BRE
mode, but enabling this code unconditionally breaks a huge number of
ERE test cases.
Rich Felker 13 年之前
父節點
當前提交
e9cddc8e32
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      src/regex/regcomp.c

+ 2 - 0
src/regex/regcomp.c

@@ -1353,6 +1353,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)