From 748f9091f42b2542b122cc895506705aaa0ea6a4 Mon Sep 17 00:00:00 2001 From: jvdias Date: Fri, 14 Jul 2006 00:50:57 +0000 Subject: [PATCH] fix upstream bug 34297 --- perl-5.8.8-U34297_C28006.patch | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 perl-5.8.8-U34297_C28006.patch diff --git a/perl-5.8.8-U34297_C28006.patch b/perl-5.8.8-U34297_C28006.patch new file mode 100644 index 0000000..556cb66 --- /dev/null +++ b/perl-5.8.8-U34297_C28006.patch @@ -0,0 +1,26 @@ +--- perl-5.8.8/pp.c.U34297_C28006 2006-07-13 12:40:37.000000000 -0400 ++++ perl-5.8.8/pp.c 2006-07-13 13:03:19.000000000 -0400 +@@ -2949,7 +2949,22 @@ + dSP; dTARGET; + SV *sv = TOPs; + +- if (DO_UTF8(sv)) ++ if (SvAMAGIC(sv)) { ++ /* For an overloaded scalar, we can't know in advance if it's going to ++ be UTF-8 or not. Also, we can't call sv_len_utf8 as it likes to ++ cache the length. Maybe that should be a documented feature of it. ++ */ ++ STRLEN len; ++ const char *const p = SvPV_const(sv, len); ++ ++ if (DO_UTF8(sv)) { ++ SETi(utf8_length((U8*)p, (U8*)p + len)); ++ } ++ else ++ SETi(len); ++ ++ } ++ else if (DO_UTF8(sv)) + SETi(sv_len_utf8(sv)); + else + SETi(sv_len(sv));