summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorAbhijit Menon-Sen <ams@wiw.org>2002-11-05 03:43:46 +0000
committerAbhijit Menon-Sen <ams@wiw.org>2002-11-05 03:43:46 +0000
commit34aa158557bf899117e749eb5a8375ffe870f5d0 (patch)
treecb258c547a71a7e45c1a35a243349b250bcbf02c /pp.c
parent107c23634640452662c18f6ae1ae0d2920a4cf3b (diff)
downloadperl-34aa158557bf899117e749eb5a8375ffe870f5d0.tar.gz
1. Update pp_ucfirst to enter the UTF-8 branch only if the first
character is UTF-8. (Copied from pp_lcfirst.) 2. sv_dump() should display FLAGS=...,UTF8 for both POK and pPOK. p4raw-id: //depot/perl@18107
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/pp.c b/pp.c
index 47e512c51d..4c05aab23a 100644
--- a/pp.c
+++ b/pp.c
@@ -3323,14 +3323,12 @@ PP(pp_ucfirst)
register U8 *s;
STRLEN slen;
- if (DO_UTF8(sv)) {
+ if (DO_UTF8(sv) && (s = (U8*)SvPV(sv, slen)) && slen && UTF8_IS_START(*s)) {
U8 tmpbuf[UTF8_MAXLEN_UCLC+1];
STRLEN ulen;
STRLEN tculen;
- s = (U8*)SvPV(sv, slen);
utf8_to_uvchr(s, &ulen);
-
toTITLE_utf8(s, tmpbuf, &tculen);
utf8_to_uvchr(tmpbuf, 0);
@@ -3385,7 +3383,6 @@ PP(pp_lcfirst)
toLOWER_utf8(s, tmpbuf, &ulen);
uv = utf8_to_uvchr(tmpbuf, 0);
-
tend = uvchr_to_utf8(tmpbuf, uv);
if (!SvPADTMP(sv) || (STRLEN)(tend - tmpbuf) != ulen || SvREADONLY(sv)) {