From: Gurusamy Sarathy Date: Fri, 28 May 1999 16:37:26 +0000 (+0000) Subject: change#3449 wasn't doing enough X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2692f720225eadd5a0dcbb17c23107401470624b;p=p5sagit%2Fp5-mst-13.2.git change#3449 wasn't doing enough p4raw-link: @3449 on //depot/perl: 18228614d1dac2db099ef3d8846e53f44accce72 p4raw-id: //depot/perl@3493 --- diff --git a/op.c b/op.c index fa286f8..c1c6066 100644 --- a/op.c +++ b/op.c @@ -5433,10 +5433,12 @@ ck_subr(OP *o) { GV *gv = (GV*)((SVOP*)gvop)->op_sv; OP *sibling = o2->op_sibling; + SV *n = newSVpvn("",0); op_free(o2); - o2 = newSVOP(OP_CONST, 0, - newSVpvn(GvNAME(gv), - GvNAMELEN(gv))); + gv_fullname3(n, gv, ""); + if (SvCUR(n)>6 && strnEQ(SvPVX(n),"main::",6)) + sv_chop(n, SvPVX(n)+6); + o2 = newSVOP(OP_CONST, 0, n); prev->op_sibling = o2; o2->op_sibling = sibling; } diff --git a/t/comp/proto.t b/t/comp/proto.t index 3474a7e..6d60342 100755 --- a/t/comp/proto.t +++ b/t/comp/proto.t @@ -419,6 +419,7 @@ print "ok ", $i++, "\n"; sub star (*&) { &{$_[1]} } sub star2 (**&) { &{$_[2]} } sub BAR { "quux" } +sub Bar::BAZ { "quuz" } my $star = 'FOO'; star FOO, sub { print "ok $i\n" if $_[0] eq 'FOO' }; $i++; star(FOO, sub { print "ok $i\n" if $_[0] eq 'FOO' }); $i++; @@ -432,8 +433,8 @@ star \*FOO, sub { print "ok $i\n" if $_[0] eq \*FOO }; $i++; star(\*FOO, sub { print "ok $i\n" if $_[0] eq \*FOO }); $i++; star2 FOO, BAR, sub { print "ok $i\n" if $_[0] eq 'FOO' and $_[1] eq 'BAR' }; $i++; -star2(BAR, FOO, sub { print "ok $i\n" - if $_[0] eq 'BAR' and $_[1] eq 'FOO' }); $i++; +star2(Bar::BAZ, FOO, sub { print "ok $i\n" + if $_[0] eq 'Bar::BAZ' and $_[1] eq 'FOO' }); $i++; star2 BAR(), FOO, sub { print "ok $i\n" if $_[0] eq 'quux' and $_[1] eq 'FOO' }; $i++; star2(FOO, BAR(), sub { print "ok $i\n"