This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
tweak change#2245 to skip previous message if any
authorGurusamy Sarathy <gsar@cpan.org>
Wed, 18 Nov 1998 05:39:36 +0000 (05:39 +0000)
committerGurusamy Sarathy <gsar@cpan.org>
Wed, 18 Nov 1998 05:39:36 +0000 (05:39 +0000)
p4raw-link: @2245 on //depot/perl: a99e4ac224ca891463a7704e48b83906ece3bb7c

p4raw-id: //depot/perl@2248

pp_ctl.c
t/pragma/warn/pp_ctl

index e4b8a73..e081fa5 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -1253,8 +1253,10 @@ die_where(char *message)
                        SvGROW(err, SvCUR(err)+sizeof(prefix)+klen);
                        sv_catpvn(err, prefix, sizeof(prefix)-1);
                        sv_catpvn(err, message, klen);
-                       if (ckWARN(WARN_UNSAFE))
-                           warner(WARN_UNSAFE, SvPVX(err));
+                       if (ckWARN(WARN_UNSAFE)) {
+                           STRLEN start = SvCUR(err)-klen-sizeof(prefix)+1;
+                           warner(WARN_UNSAFE, SvPVX(err)+start);
+                       }
                    }
                    sv_inc(*svp);
                }
index 70c67fa..5a1c233 100644 (file)
@@ -153,5 +153,7 @@ use warning 'unsafe' ;
 package Foo;
 DESTROY { die "@{$_[0]} foo bar" }
 { bless ['A'], 'Foo' for 1..10 }
+{ bless ['B'], 'Foo' for 1..10 }
 EXPECT
        (in cleanup) A foo bar at - line 4.
+       (in cleanup) B foo bar at - line 4.