(Retracted by #8264) Tweak sv_catsv() some more.
Jarkko Hietaniemi [Sat, 30 Dec 2000 01:08:32 +0000 (01:08 +0000)]
p4raw-id: //depot/perl@8263

sv.c

diff --git a/sv.c b/sv.c
index 7f70502..208cc10 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -3776,8 +3776,7 @@ Perl_sv_catsv(pTHX_ SV *dsv, register SV *ssv)
                if (!dutf8)
                    sv_utf8_upgrade(dsv);
                dpv = SvPV(dsv, dlen);
-               /* Overguestimate on the slen. */
-               SvGROW(dsv, dlen + (sutf8 ? 2 * slen : slen) + 1);
+               SvGROW(dsv, dlen + 2 * slen + 1);
                if (dutf8) /* && !sutf8 */ {
                    char *s = spv;
                    char *e = s + slen;