summaryrefslogtreecommitdiff
path: root/utf8.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-04-19 12:13:29 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-04-19 12:13:29 +0000
commit6eb6869e2f02678a2e46aaaf15795b052fc0297b (patch)
tree882726953770df87e8970e2a7ac088f069992ad8 /utf8.c
parent9d43a7557743d779c74d69ffc6df7fc17711f3ec (diff)
downloadperl-6eb6869e2f02678a2e46aaaf15795b052fc0297b.tar.gz
A better fix for the \x{12345678} trouble from NI-S.
p4raw-id: //depot/perl@9755
Diffstat (limited to 'utf8.c')
-rw-r--r--utf8.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/utf8.c b/utf8.c
index 1694c0d5aa..fda9920933 100644
--- a/utf8.c
+++ b/utf8.c
@@ -163,20 +163,15 @@ Perl_is_utf8_char(pTHX_ U8 *s)
slen = len - 1;
s++;
- /* The initial value is dubious */
+ u &= UTF_START_MASK(len);
uv = u;
ouv = uv;
while (slen--) {
if (!UTF8_IS_CONTINUATION(*s))
return 0;
uv = UTF8_ACCUMULATE(uv, *s);
-#if 0
- /* Depending on the compiler the wrap of the value takig pladve
- * between 5 and 6 bytes of UTF-8 encoding either works or not.
- * See similar spot in utf8_to_uvuni(). --jhi */
if (uv < ouv)
return 0;
-#endif
ouv = uv;
s++;
}
@@ -347,14 +342,9 @@ Perl_utf8n_to_uvuni(pTHX_ U8 *s, STRLEN curlen, STRLEN *retlen, U32 flags)
}
}
else { /* uv < ouv */
-#if 0
- /* Depending on the compiler the wrap of the value takig pladve
- * between 5 and 6 bytes of UTF-8 encoding either works or not.
- * See similar spot in is_utf8_char(). --jhi */
/* This cannot be allowed. */
warning = UTF8_WARN_OVERFLOW;
goto malformed;
-#endif
}
}
s++;