diff options
author | Yitzchak Scott-Thoennes <sthoenna@efn.org> | 2007-02-12 14:13:50 -0800 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2007-03-26 14:33:41 +0000 |
commit | 3ca3bb6f35492332d8741078a5631986b1e06b9d (patch) | |
tree | 4a3e6b8b252a75829308f2fc8331c95380f64c90 | |
parent | b14399855b4df2051e11477e4e745c80bb82b015 (diff) | |
download | perl-3ca3bb6f35492332d8741078a5631986b1e06b9d.tar.gz |
Re: substr($megabytes, 30) =
From: "Yitzchak Scott-Thoennes" <sthoenna@efn.org>
Message-ID: <1119.63.226.247.186.1171347230.squirrel@63.226.247.186>
p4raw-id: //depot/perl@30762
-rw-r--r-- | pp.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -3014,13 +3014,13 @@ PP(pp_substr) I32 pos; I32 rem; I32 fail; - const I32 lvalue = PL_op->op_flags & OPf_MOD || LVRET; + const int num_args = PL_op->op_private & 7; + const I32 lvalue = num_args <= 3 && ( PL_op->op_flags & OPf_MOD || LVRET ); const char *tmps; const I32 arybase = CopARYBASE_get(PL_curcop); SV *repl_sv = NULL; const char *repl = NULL; STRLEN repl_len; - const int num_args = PL_op->op_private & 7; bool repl_need_utf8_upgrade = FALSE; bool repl_is_utf8 = FALSE; @@ -3115,7 +3115,8 @@ PP(pp_substr) } } - sv_setpvn(TARG, tmps, rem); + if (! lvalue) + sv_setpvn(TARG, tmps, rem); #ifdef USE_LOCALE_COLLATE sv_unmagic(TARG, PERL_MAGIC_collxfrm); #endif |