diff options
author | Karl Williamson <khw@cpan.org> | 2019-06-28 23:57:31 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2019-07-01 19:38:00 -0600 |
commit | 82651abe60a8c1ca1f9eb6aae0202ecfd34bfecf (patch) | |
tree | c6d1ca001a6040c9e60c9a3260ce8323a2d99985 /utf8.h | |
parent | 34b633732d69b4cd1ac2f7d38cbcb76fa2e2c7ca (diff) | |
download | perl-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.h | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -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) \ |