summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2002-02-24 05:28:15 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2002-02-24 05:28:15 +0000
commit0ebc6274038e153e550e59b772cf72a406234aaa (patch)
tree0ae77a91505743ba82cbd659a6d3813f43538abc /regcomp.c
parent8f94de01b0ec23d3da0be11e7e9ccad913e01fae (diff)
downloadperl-0ebc6274038e153e550e59b772cf72a406234aaa.tar.gz
EBCDIC: this seems to calm the last of the
Malformed UTF-8 warnings. p4raw-id: //depot/perl@14850
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c32
1 files changed, 20 insertions, 12 deletions
diff --git a/regcomp.c b/regcomp.c
index b453116e5c..854dc5950d 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -3182,6 +3182,8 @@ tryagain:
if (len)
p = oldp;
else if (UTF) {
+ STRLEN unilen;
+
if (FOLD) {
/* Emit all the Unicode characters. */
for (foldbuf = tmpbuf;
@@ -3189,9 +3191,11 @@ tryagain:
foldlen -= numlen) {
ender = utf8_to_uvchr(foldbuf, &numlen);
if (numlen > 0) {
- reguni(pRExC_state, ender, s, &numlen);
- s += numlen;
- len += numlen;
+ reguni(pRExC_state, ender, s, &unilen);
+ s += unilen;
+ len += unilen;
+ /* In EBCDIC the numlen
+ * and unilen can differ. */
foldbuf += numlen;
if (numlen >= foldlen)
break;
@@ -3201,10 +3205,10 @@ tryagain:
}
}
else {
- reguni(pRExC_state, ender, s, &numlen);
+ reguni(pRExC_state, ender, s, &unilen);
if (numlen > 0) {
- s += numlen;
- len += numlen;
+ s += unilen;
+ len += unilen;
}
}
}
@@ -3215,6 +3219,8 @@ tryagain:
break;
}
if (UTF) {
+ STRLEN unilen;
+
if (FOLD) {
/* Emit all the Unicode characters. */
for (foldbuf = tmpbuf;
@@ -3222,9 +3228,11 @@ tryagain:
foldlen -= numlen) {
ender = utf8_to_uvchr(foldbuf, &numlen);
if (numlen > 0) {
- reguni(pRExC_state, ender, s, &numlen);
- len += numlen;
- s += numlen;
+ reguni(pRExC_state, ender, s, &unilen);
+ len += unilen;
+ s += unilen;
+ /* In EBCDIC the numlen
+ * and unilen can differ. */
foldbuf += numlen;
if (numlen >= foldlen)
break;
@@ -3234,10 +3242,10 @@ tryagain:
}
}
else {
- reguni(pRExC_state, ender, s, &numlen);
+ reguni(pRExC_state, ender, s, &unilen);
if (numlen > 0) {
- s += numlen;
- len += numlen;
+ s += unilen;
+ len += unilen;
}
}
len--;