This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add t/op/lc.t to see if lc, uc, lcfirst, ucfirst, quotemeta work.
[perl5.git] / pp.c
diff --git a/pp.c b/pp.c
index a051268..65b1f17 100644 (file)
--- a/pp.c
+++ b/pp.c
@@ -3015,8 +3015,10 @@ PP(pp_ucfirst)
            SvTAINTED_on(sv);
            uv = toTITLE_LC_uvchr(utf8n_to_uvchr(s, slen, &ulen, 0));
        }
-       else
-           uv = toTITLE_utf8(s);
+       else {
+           uv   = toTITLE_utf8(s);
+           ulen = UNISKIP(uv);
+       }
        
        tend = uvchr_to_utf8(tmpbuf, uv);
 
@@ -3074,8 +3076,10 @@ PP(pp_lcfirst)
            SvTAINTED_on(sv);
            uv = toLOWER_LC_uvchr(utf8n_to_uvchr(s, slen, &ulen, 0));
        }
-       else
-           uv = toLOWER_utf8(s);
+       else {
+           uv   = toLOWER_utf8(s);
+           ulen = UNISKIP(uv);
+       }
        
        tend = uvchr_to_utf8(tmpbuf, uv);