A correction to change 34909 - we want *different* constants.
[p5sagit/p5-mst-13.2.git] / pp_ctl.c
index 268bb35..8e89cb9 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -2764,7 +2764,7 @@ S_save_lines(pTHX_ AV *array, SV *sv)
        const char *t;
        SV * const tmpstr = newSV_type(SVt_PVMG);
 
-       t = strchr(s, '\n');
+       t = (const char *)memchr(s, '\n', send - s);
        if (t)
            t++;
        else
@@ -3653,7 +3653,7 @@ PP(pp_entereval)
     register PERL_CONTEXT *cx;
     SV *sv;
     const I32 gimme = GIMME_V;
-    const I32 was = PL_sub_generation;
+    const U32 was = PL_breakable_sub_gen;
     char tbuf[TYPE_DIGITS(long) + 12];
     char *tmpbuf = tbuf;
     char *safestr;
@@ -3662,9 +3662,7 @@ PP(pp_entereval)
     CV* runcv;
     U32 seq;
     HV *saved_hh = NULL;
-    const char * const fakestr = "_<(eval )";
-    const int fakelen = 9 + 1;
-    
+
     if (PL_op->op_private & OPpEVAL_HAS_HH) {
        saved_hh = MUTABLE_HV(SvREFCNT_inc(POPs));
     }
@@ -3733,10 +3731,15 @@ PP(pp_entereval)
     PUTBACK;
     ok = doeval(gimme, NULL, runcv, seq);
     if ((PERLDB_LINE || PERLDB_SAVESRC)
-       && was != (I32)PL_sub_generation /* Some subs defined here. */
+       && was != PL_breakable_sub_gen /* Some subs defined here. */
        && ok) {
-       /* Copy in anything fake and short. */
-       my_strlcpy(safestr, fakestr, fakelen);
+       /* Just need to change the string in our writable scratch buffer that
+          will be used at scope exit to delete this eval's "file" name, to
+          something safe. The key names are of the form "_<(eval 1)" upwards,
+          so the 8th char is the first digit, which will not have a leading
+          zero. So give it a leading zero, and it can't match anything, but
+          still sits within the pattern space "reserved" for evals.  */
+       safestr[8] = '0';
     }
     return ok ? DOCATCH(PL_eval_start) : PL_op->op_next;
 }