Remove a vestigial STRLEN case and convert a label to lowercase.
authorNicholas Clark <nick@ccl4.org>
Sun, 14 Feb 2010 16:04:35 +0000 (16:04 +0000)
committerNicholas Clark <nick@ccl4.org>
Sun, 14 Feb 2010 16:32:29 +0000 (16:32 +0000)
(Tweaking 777f7c561610dee6.)

mg.c
pp.c

diff --git a/mg.c b/mg.c
index 4f8207c..3f51a17 100644 (file)
--- a/mg.c
+++ b/mg.c
@@ -2020,7 +2020,7 @@ Perl_magic_getsubstr(pTHX_ SV *sv, MAGIC *mg)
        offs = len;
     if (rem > len - offs)
        rem = len - offs;
-    sv_setpvn(sv, tmps + offs, (STRLEN)rem);
+    sv_setpvn(sv, tmps + offs, rem);
     if (SvUTF8(lsv))
         SvUTF8_on(sv);
     return 0;
diff --git a/pp.c b/pp.c
index 95dc5fd..8f01e85 100644 (file)
--- a/pp.c
+++ b/pp.c
@@ -3139,12 +3139,12 @@ PP(pp_substr)
        UV pos1_uv = pos1_iv-arybase;
        /* Overflow can occur when $[ < 0 */
        if (arybase < 0 && pos1_uv < (UV)pos1_iv)
-           goto BOUND_FAIL;
+           goto bound_fail;
        pos1_iv = pos1_uv;
        pos1_is_uv = 1;
     }
     else if (pos1_is_uv ? (UV)pos1_iv > 0 : pos1_iv > 0) {
-       goto BOUND_FAIL;  /* $[=3; substr($_,2,...) */
+       goto bound_fail;  /* $[=3; substr($_,2,...) */
     }
     else { /* pos < $[ */
        if (pos1_iv == 0) { /* $[=1; substr($_,0,...) */
@@ -3159,7 +3159,7 @@ PP(pp_substr)
     }
     if (pos1_is_uv || pos1_iv > 0) {
        if ((UV)pos1_iv > curlen)
-           goto BOUND_FAIL;
+           goto bound_fail;
     }
 
     if (num_args > 2) {
@@ -3189,7 +3189,7 @@ PP(pp_substr)
 
     if (!pos2_is_uv && pos2_iv < 0) {
        if (!pos1_is_uv && pos1_iv < 0)
-           goto BOUND_FAIL;
+           goto bound_fail;
        pos2_iv = 0;
     }
     else if (!pos1_is_uv && pos1_iv < 0)
@@ -3277,7 +3277,7 @@ PP(pp_substr)
     PUSHs(TARG);               /* avoid SvSETMAGIC here */
     RETURN;
 
-BOUND_FAIL:
+bound_fail:
     if (lvalue || repl)
        Perl_croak(aTHX_ "substr outside of string");
     Perl_ck_warner(aTHX_ packWARN(WARN_SUBSTR), "substr outside of string");