Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/bsd/tre/dist/lib Disable tre_reg*b() when we don't ...
details: https://anonhg.NetBSD.org/src/rev/388f6b48411e
branches: trunk
changeset: 357606:388f6b48411e
user: rin <rin%NetBSD.org@localhost>
date: Fri Nov 17 16:16:19 2017 +0000
description:
Disable tre_reg*b() when we don't have REG_USEBYTES.
diffstat:
external/bsd/tre/dist/lib/regcomp.c | 4 ++++
external/bsd/tre/dist/lib/regexec.c | 4 ++++
external/bsd/tre/dist/lib/tre-compile.c | 4 ++++
3 files changed, 12 insertions(+), 0 deletions(-)
diffs (85 lines):
diff -r 0ce016d5d254 -r 388f6b48411e external/bsd/tre/dist/lib/regcomp.c
--- a/external/bsd/tre/dist/lib/regcomp.c Fri Nov 17 16:14:30 2017 +0000
+++ b/external/bsd/tre/dist/lib/regcomp.c Fri Nov 17 16:16:19 2017 +0000
@@ -99,6 +99,7 @@
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 @@
return ret;
}
+#endif /* REG_USEBYTES */
int
tre_regcomp(regex_t *preg, const char *regex, int cflags)
@@ -130,6 +132,7 @@
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 @@
xfree(wregex);
return ret;
}
+#endif /* REG_USEBYTES */
#ifdef TRE_WCHAR
diff -r 0ce016d5d254 -r 388f6b48411e external/bsd/tre/dist/lib/regexec.c
--- a/external/bsd/tre/dist/lib/regexec.c Fri Nov 17 16:14:30 2017 +0000
+++ b/external/bsd/tre/dist/lib/regexec.c Fri Nov 17 16:16:19 2017 +0000
@@ -227,6 +227,7 @@
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 @@
return tre_match(tnfa, str, len, STR_BYTE, nmatch, pmatch, eflags);
}
+#endif /* REG_USEBYTES */
#ifdef TRE_WCHAR
@@ -364,6 +366,7 @@
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 @@
return tre_match_approx(tnfa, str, (unsigned)-1, STR_BYTE,
match, params, eflags);
}
+#endif /* REG_USEBYTES */
#ifdef TRE_WCHAR
diff -r 0ce016d5d254 -r 388f6b48411e external/bsd/tre/dist/lib/tre-compile.c
--- a/external/bsd/tre/dist/lib/tre-compile.c Fri Nov 17 16:14:30 2017 +0000
+++ b/external/bsd/tre/dist/lib/tre-compile.c Fri Nov 17 16:16:19 2017 +0000
@@ -1891,7 +1891,11 @@
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)
Home |
Main Index |
Thread Index |
Old Index