View | Details | Raw Unified | Return to bug 15660 | Differences between
and this patch

Collapse All | Expand All

(-)tre-0.8.0/lib/tre-compile.c.Rfixes (+2 lines)
Lines 1890-1895 tre_compile(regex_t *preg, const tre_cha Link Here
1890
  parse_ctx.len = n;
1890
  parse_ctx.len = n;
1891
  parse_ctx.cflags = cflags;
1891
  parse_ctx.cflags = cflags;
1892
  parse_ctx.max_backref = -1;
1892
  parse_ctx.max_backref = -1;
1893
/* workaround for PR#14408: use 8-bit optimizations in 8-bit mode */
1894
  parse_ctx.cur_max = (cflags & REG_USEBYTES) ? 1 : TRE_MB_CUR_MAX;
1893
  DPRINT(("tre_compile: parsing '%.*" STRF "'\n", (int)n, regex));
1895
  DPRINT(("tre_compile: parsing '%.*" STRF "'\n", (int)n, regex));
1894
  errcode = tre_parse(&parse_ctx);
1896
  errcode = tre_parse(&parse_ctx);
1895
  if (errcode != REG_OK)
1897
  if (errcode != REG_OK)
(-)tre-0.8.0/lib/tre.h.Rfixes (+2 lines)
Lines 106-111 typedef enum { Link Here
106
#define REG_RIGHT_ASSOC (REG_LITERAL << 1)
106
#define REG_RIGHT_ASSOC (REG_LITERAL << 1)
107
#define REG_UNGREEDY    (REG_RIGHT_ASSOC << 1)
107
#define REG_UNGREEDY    (REG_RIGHT_ASSOC << 1)
108
108
109
#define REG_USEBYTES    (REG_UNGREEDY << 1)
110
109
/* POSIX tre_regexec() flags. */
111
/* POSIX tre_regexec() flags. */
110
#define REG_NOTBOL 1
112
#define REG_NOTBOL 1
111
#define REG_NOTEOL (REG_NOTBOL << 1)
113
#define REG_NOTEOL (REG_NOTBOL << 1)
(-)tre-0.8.0/lib/tre-parse.c.Rfixes (-1 / +1 lines)
Lines 332-338 tre_parse_bracket_items(tre_parse_ctx_t Link Here
332
		  if (!class)
332
		  if (!class)
333
		    status = REG_ECTYPE;
333
		    status = REG_ECTYPE;
334
		  /* Optimize character classes for 8 bit character sets. */
334
		  /* Optimize character classes for 8 bit character sets. */
335
		  if (status == REG_OK && TRE_MB_CUR_MAX == 1)
335
		  if (status == REG_OK && ctx->cur_max == 1)
336
		    {
336
		    {
337
		      status = tre_expand_ctype(ctx->mem, class, items,
337
		      status = tre_expand_ctype(ctx->mem, class, items,
338
						&i, &max_i, ctx->cflags);
338
						&i, &max_i, ctx->cflags);
(-)tre-0.8.0/lib/tre-parse.h.Rfixes (+2 lines)
Lines 38-43 typedef struct { Link Here
38
  int nofirstsub;
38
  int nofirstsub;
39
  /* The currently set approximate matching parameters. */
39
  /* The currently set approximate matching parameters. */
40
  int params[TRE_PARAM_LAST];
40
  int params[TRE_PARAM_LAST];
41
  /* the CUR_MAX in use */
42
  int cur_max;
41
} tre_parse_ctx_t;
43
} tre_parse_ctx_t;
42
44
43
/* Parses a wide character regexp pattern into a syntax tree.  This parser
45
/* Parses a wide character regexp pattern into a syntax tree.  This parser

Return to bug 15660