summaryrefslogtreecommitdiff
path: root/utf8.h
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2019-06-28 23:57:31 -0600
committerKarl Williamson <khw@cpan.org>2019-07-01 19:38:00 -0600
commit82651abe60a8c1ca1f9eb6aae0202ecfd34bfecf (patch)
treec6d1ca001a6040c9e60c9a3260ce8323a2d99985 /utf8.h
parent34b633732d69b4cd1ac2f7d38cbcb76fa2e2c7ca (diff)
downloadperl-82651abe60a8c1ca1f9eb6aae0202ecfd34bfecf.tar.gz
utf8_to_uvchr_buf() make behavior match docs
For well formed input, there is no change. But for malformed it wasn't returning the documented length when warnings were enabled, and not always the documented value when they were disabled. This is implemented as an inline function, called from both the macro and the Perl_ form. Devel::PPPort has sufficient tests for this.
Diffstat (limited to 'utf8.h')
-rw-r--r--utf8.h4
1 files changed, 1 insertions, 3 deletions
diff --git a/utf8.h b/utf8.h
index d0b8742d5a..88e74de746 100644
--- a/utf8.h
+++ b/utf8.h
@@ -69,9 +69,7 @@ the string is invariant.
#define uvchr_to_utf8_flags_msgs(d,uv,flags,msgs) \
uvoffuni_to_utf8_flags_msgs(d,NATIVE_TO_UNI(uv),flags, msgs)
#define utf8_to_uvchr_buf(s, e, lenp) \
- (__ASSERT_((U8*) (e) > (U8*) (s)) \
- utf8n_to_uvchr(s, (U8*)(e) - (U8*)(s), lenp, \
- ckWARN_d(WARN_UTF8) ? 0 : UTF8_ALLOW_ANY))
+ _utf8_to_uvchr_buf((const U8 *) (s), (const U8 *) e, lenp)
#define utf8n_to_uvchr(s, len, lenp, flags) \
utf8n_to_uvchr_error(s, len, lenp, flags, 0)
#define utf8n_to_uvchr_error(s, len, lenp, flags, errors) \