summaryrefslogtreecommitdiff
path: root/gv.c
diff options
context:
space:
mode:
authorDave Mitchell <davem@fdisolutions.com>2004-03-28 15:08:23 +0000
committerDave Mitchell <davem@fdisolutions.com>2004-03-28 15:08:23 +0000
commit4ad16c232af72afff4d7d0d37f532c709df5d9f0 (patch)
treea1929af1b39420f55850b65678d17e13915347d0 /gv.c
parent46316b0a1e18bbab306c955d1ad4c7942f675812 (diff)
downloadperl-4ad16c232af72afff4d7d0d37f532c709df5d9f0.tar.gz
make gv_fullname() etc include a literal '^' for *^FOO style names
p4raw-id: //depot/perl@22606
Diffstat (limited to 'gv.c')
-rw-r--r--gv.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gv.c b/gv.c
index 8a270650b9..b2ae13c46a 100644
--- a/gv.c
+++ b/gv.c
@@ -1096,7 +1096,13 @@ Perl_gv_fullname4(pTHX_ SV *sv, GV *gv, const char *prefix, bool keepmain)
sv_catpv(sv,name);
sv_catpvn(sv,"::", 2);
}
- sv_catpvn(sv,GvNAME(gv),GvNAMELEN(gv));
+ if (((unsigned int)*GvNAME(gv)) <= 26) { /* handle $^FOO */
+ Perl_sv_catpvf(aTHX_ sv,"^%c", *GvNAME(gv) + 'A' - 1);
+ sv_catpvn(sv,GvNAME(gv)+1,GvNAMELEN(gv)-1);
+ }
+ else
+ sv_catpvn(sv,GvNAME(gv),GvNAMELEN(gv));
+
}
void