Module Name:    src
Committed By:   rin
Date:           Fri Nov 17 16:16:19 UTC 2017

Modified Files:
        src/external/bsd/tre/dist/lib: regcomp.c regexec.c tre-compile.c

Log Message:
Disable tre_reg*b() when we don't have REG_USEBYTES.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/tre/dist/lib/regcomp.c
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/tre/dist/lib/regexec.c
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/tre/dist/lib/tre-compile.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/tre/dist/lib/regcomp.c
diff -u src/external/bsd/tre/dist/lib/regcomp.c:1.4 src/external/bsd/tre/dist/lib/regcomp.c:1.5
--- src/external/bsd/tre/dist/lib/regcomp.c:1.4	Fri Nov 17 16:14:30 2017
+++ src/external/bsd/tre/dist/lib/regcomp.c	Fri Nov 17 16:16:19 2017
@@ -99,6 +99,7 @@ tre_regncomp(regex_t *preg, const char *
   return ret;
 }
 
+#ifdef REG_USEBYTES
 /* this version takes bytes literally, to be used with raw vectors */
 int
 tre_regncompb(regex_t *preg, const char *regex, size_t n, int cflags)
@@ -123,6 +124,7 @@ tre_regncompb(regex_t *preg, const char 
 
   return ret;
 }
+#endif /* REG_USEBYTES */
 
 int
 tre_regcomp(regex_t *preg, const char *regex, int cflags)
@@ -130,6 +132,7 @@ tre_regcomp(regex_t *preg, const char *r
   return tre_regncomp(preg, regex, regex ? strlen(regex) : 0, cflags);
 }
 
+#ifdef REG_USEBYTES
 int
 tre_regcompb(regex_t *preg, const char *regex, int cflags)
 {
@@ -151,6 +154,7 @@ tre_regcompb(regex_t *preg, const char *
   xfree(wregex);
   return ret;
 }
+#endif /* REG_USEBYTES */
 
 
 #ifdef TRE_WCHAR

Index: src/external/bsd/tre/dist/lib/regexec.c
diff -u src/external/bsd/tre/dist/lib/regexec.c:1.8 src/external/bsd/tre/dist/lib/regexec.c:1.9
--- src/external/bsd/tre/dist/lib/regexec.c:1.8	Fri Nov 17 16:14:30 2017
+++ src/external/bsd/tre/dist/lib/regexec.c	Fri Nov 17 16:16:19 2017
@@ -227,6 +227,7 @@ tre_regexec(const regex_t *preg, const c
 	return ret;
 }
 
+#ifdef REG_USEBYTES
 int
 tre_regexecb(const regex_t *preg, const char *str,
         size_t nmatch, regmatch_t pmatch[], int eflags)
@@ -244,6 +245,7 @@ tre_regnexecb(const regex_t *preg, const
 
   return tre_match(tnfa, str, len, STR_BYTE, nmatch, pmatch, eflags);
 }
+#endif /* REG_USEBYTES */
 
 
 #ifdef TRE_WCHAR
@@ -364,6 +366,7 @@ tre_regaexec(const regex_t *preg, const 
   return tre_reganexec(preg, str, (unsigned)-1, match, params, eflags);
 }
 
+#ifdef REG_USEBYTES
 int
 tre_regaexecb(const regex_t *preg, const char *str,
           regamatch_t *match, regaparams_t params, int eflags)
@@ -373,6 +376,7 @@ tre_regaexecb(const regex_t *preg, const
   return tre_match_approx(tnfa, str, (unsigned)-1, STR_BYTE,
                           match, params, eflags);
 }
+#endif /* REG_USEBYTES */
 
 #ifdef TRE_WCHAR
 

Index: src/external/bsd/tre/dist/lib/tre-compile.c
diff -u src/external/bsd/tre/dist/lib/tre-compile.c:1.3 src/external/bsd/tre/dist/lib/tre-compile.c:1.4
--- src/external/bsd/tre/dist/lib/tre-compile.c:1.3	Fri Nov 17 16:14:30 2017
+++ src/external/bsd/tre/dist/lib/tre-compile.c	Fri Nov 17 16:16:19 2017
@@ -1891,7 +1891,11 @@ tre_compile(regex_t *preg, const tre_cha
   parse_ctx.cflags = cflags;
   parse_ctx.max_backref = -1;
   /* workaround for PR#14408: use 8-bit optimizations in 8-bit mode */
+#ifdef REG_USEBYTES
   parse_ctx.cur_max = (cflags & REG_USEBYTES) ? 1 : TRE_MB_CUR_MAX;
+#else
+  parse_ctx.cur_max = TRE_MB_CUR_MAX;
+#endif
   DPRINT(("tre_compile: parsing '%.*" STRF "'\n", (int)n, regex));
   errcode = tre_parse(&parse_ctx);
   if (errcode != REG_OK)

Reply via email to