$foo .= $bar doesn't warn if $foo is undefined, so simplify code.
[p5sagit/p5-mst-13.2.git] / sv.c
diff --git a/sv.c b/sv.c
index 3f44139..08d9b6a 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -1738,7 +1738,11 @@ S_glob_2inpuv(pTHX_ GV *gv, STRLEN *len, bool want_number)
           can tail call us and return true.  */
        return (char *) 1;
     } else {
-       return SvPV(buffer, *len);
+       assert(SvPOK(buffer));
+       if (len) {
+           *len = SvCUR(buffer);
+       }
+       return SvPVX(buffer);
     }
 }
 
@@ -10677,21 +10681,9 @@ Perl_ss_dup(pTHX_ PerlInterpreter *proto_perl, CLONE_PARAMS* param)
 #endif
                break;
            }
-       case SAVEt_COP_WARNINGS:
-           {
-               void *optr = POPPTR(ss,ix);
-               TOPPTR(nss,ix) = ptr = any_dup(optr, proto_perl);
-               if (ptr != optr) {
-                   /* We duped something in the interpreter structure.  */
-                   ptr = POPPTR(ss,ix);
-                   TOPPTR(nss,ix) = DUP_WARNINGS((STRLEN*)ptr);
-               } else {
-                   /* I don't think that this happens, but it would mean that
-                      we (didn't) dup something shared.  */
-                   ptr = POPPTR(ss,ix);
-                   TOPPTR(nss,ix) = ptr;
-               }
-           }
+       case SAVEt_COMPILE_WARNINGS:
+           ptr = POPPTR(ss,ix);
+           TOPPTR(nss,ix) = DUP_WARNINGS((STRLEN*)ptr);
            break;
        default:
            Perl_croak(aTHX_ "panic: ss_dup inconsistency (%"IVdf")", (IV) i);