X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pp.c;h=b2aa8e6677d9a02950cce53d922812e34597c128;hb=8c7d55fc02cca4e0edf1324c36f667376289f8d2;hp=00aa6e49d2cbc65f70fb066d40ae3a1c212d42d5;hpb=19a94d75aea23d860dc398284bf0810d3e2bbfa2;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pp.c b/pp.c index 00aa6e4..b2aa8e6 100644 --- a/pp.c +++ b/pp.c @@ -3014,13 +3014,13 @@ PP(pp_substr) I32 pos; I32 rem; I32 fail; - const int num_args = PL_op->op_private & 7; - const I32 lvalue = num_args <= 3 && ( PL_op->op_flags & OPf_MOD || LVRET ); + const I32 lvalue = 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,8 +3115,7 @@ PP(pp_substr) } } - if (GIMME_V != G_VOID && !lvalue) - sv_setpvn(TARG, tmps, rem); + sv_setpvn(TARG, tmps, rem); #ifdef USE_LOCALE_COLLATE sv_unmagic(TARG, PERL_MAGIC_collxfrm); #endif