change#3449 wasn't doing enough
Gurusamy Sarathy [Fri, 28 May 1999 16:37:26 +0000 (16:37 +0000)]
p4raw-link: @3449 on //depot/perl: 18228614d1dac2db099ef3d8846e53f44accce72

p4raw-id: //depot/perl@3493

op.c
t/comp/proto.t

diff --git a/op.c b/op.c
index fa286f8..c1c6066 100644 (file)
--- 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;
                            }
index 3474a7e..6d60342 100755 (executable)
@@ -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"