This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
XXX Patch for discussion: [perl #117355] [lu]cfirst don't respect 'use bytes'
authorKarl Williamson <public@khwilliamson.com>
Sun, 5 May 2013 02:42:48 +0000 (20:42 -0600)
committerTony Cook <tony@develop-help.com>
Mon, 12 Aug 2013 05:13:01 +0000 (15:13 +1000)
pp.c

diff --git a/pp.c b/pp.c
index e47500f..b61192d 100644 (file)
--- a/pp.c
+++ b/pp.c
@@ -3664,7 +3664,7 @@ PP(pp_ucfirst)
 
        /* In a "use bytes" we don't treat the source as UTF-8, but, still want
         * the destination to retain that flag */
 
        /* In a "use bytes" we don't treat the source as UTF-8, but, still want
         * the destination to retain that flag */
-       if (SvUTF8(source))
+       if (SvUTF8(source) && ! IN_BYTES)
            SvUTF8_on(dest);
 
        if (!inplace) { /* Finish the rest of the string, unchanged */
            SvUTF8_on(dest);
 
        if (!inplace) { /* Finish the rest of the string, unchanged */