In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/3eaa7592a3744136787cbdd7c77ca7b3845fdfa1?hp=589e04a1986fbfc1120748af15d5dffeb9e9586c>

- Log -----------------------------------------------------------------
commit 3eaa7592a3744136787cbdd7c77ca7b3845fdfa1
Author: Karl Williamson <[email protected]>
Date:   Mon Aug 19 14:43:30 2019 -0600

    Fix utf8_to_uvchr_buf to match docs
    
    It did so already except when passed a zero length input on
    non-debugging builds.  This caused test failures in Devel::PPPort, and
    commit 4a5ab54a18679ab24ca03190884d326c2ca85288 was used to customize
    that module in blead to get the tests to pass.
    
    This commit avoids the possibility of having to bump the version again,
    which is what that commit did.

-----------------------------------------------------------------------

Summary of changes:
 inline.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/inline.h b/inline.h
index 7d81da634f..67fbf851ea 100644
--- a/inline.h
+++ b/inline.h
@@ -1850,8 +1850,12 @@ S__utf8_to_uvchr_buf(pTHX_ const U8 *s, const U8 *send, 
STRLEN *retlen)
     assert(s < send);
 
     if (! ckWARN_d(WARN_UTF8)) {
+
+        /* EMPTY is not really allowed, and asserts on debugging builds.  But
+         * on non-debugging we have to deal with it, and this causes it to
+         * return the REPLACEMENT CHARACTER, as the documentation indicates */
         return utf8n_to_uvchr(s, send - s, retlen,
-                              (UTF8_ALLOW_ANY & ~UTF8_ALLOW_EMPTY));
+                              (UTF8_ALLOW_ANY | UTF8_ALLOW_EMPTY));
     }
     else {
         UV ret = utf8n_to_uvchr(s, send - s, retlen, 0);

-- 
Perl5 Master Repository

Reply via email to