diff options
author | Nick Ing-Simmons <nik@tiuk.ti.com> | 2002-02-03 14:54:18 +0000 |
---|---|---|
committer | Nick Ing-Simmons <nik@tiuk.ti.com> | 2002-02-03 14:54:18 +0000 |
commit | 4056517955bef99f1d248dcaf966c0e256b0ea31 (patch) | |
tree | b901e16f8b6443934dc90d1cac98b651a9920813 /sv.c | |
parent | aa0053b7f4fe5f775a26681d0e18999f5a01d34c (diff) | |
download | perl-4056517955bef99f1d248dcaf966c0e256b0ea31.tar.gz |
Fix SvGROW on an SV with SvLEN == 0 - copy in any existing data.
(Mis-feature discovered by Encode.)
p4raw-id: //depot/perlio@14526
Diffstat (limited to 'sv.c')
-rw-r--r-- | sv.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -1584,6 +1584,9 @@ Perl_sv_grow(pTHX_ register SV *sv, register STRLEN newlen) SvREADONLY_off(sv); } New(703, s, newlen, char); + if (SvPVX(sv) && SvCUR(sv)) { + Move(SvPVX(sv), s, SvCUR(sv), char); + } } SvPV_set(sv, s); SvLEN_set(sv, newlen); |