summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorVincent Pit <perl@profvince.com>2008-03-22 14:37:42 +0100
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2008-03-25 09:17:28 +0000
commit502d9230ec570254fed51ae721c1da50944a5cbf (patch)
treebcdc7c7aa1c1c2aa0043ebbeb8c0ccc8b401358d /pp.c
parentd3153aa44fba6434baddd69db421016fa7e77089 (diff)
downloadperl-502d9230ec570254fed51ae721c1da50944a5cbf.tar.gz
Re: [PATCH] Double warning with perl -we 'my $a; substr $a, 0, 10,
Message-ID: <47E4FD96.6080304@profvince.com> p4raw-id: //depot/perl@33557
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/pp.c b/pp.c
index 5b09c082d1..3551d8f1ea 100644
--- a/pp.c
+++ b/pp.c
@@ -3178,6 +3178,8 @@ PP(pp_substr)
repl = SvPV_const(repl_sv_copy, repl_len);
repl_is_utf8 = DO_UTF8(repl_sv_copy) && SvCUR(sv);
}
+ if (!SvOK(sv))
+ sv_setpvs(sv, "");
sv_insert(sv, pos, rem, repl, repl_len);
if (repl_is_utf8)
SvUTF8_on(sv);