From: Gurusamy Sarathy Date: Wed, 18 Nov 1998 05:39:36 +0000 (+0000) Subject: tweak change#2245 to skip previous message if any X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b5d92ff461a53c003570dfb3f7104a54ab2cc3d8;p=p5sagit%2Fp5-mst-13.2.git tweak change#2245 to skip previous message if any p4raw-link: @2245 on //depot/perl: a99e4ac224ca891463a7704e48b83906ece3bb7c p4raw-id: //depot/perl@2248 --- diff --git a/pp_ctl.c b/pp_ctl.c index e4b8a73..e081fa5 100644 --- 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); } diff --git a/t/pragma/warn/pp_ctl b/t/pragma/warn/pp_ctl index 70c67fa..5a1c233 100644 --- a/t/pragma/warn/pp_ctl +++ b/t/pragma/warn/pp_ctl @@ -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.