From: Nicholas Clark Date: Fri, 3 Dec 2004 18:56:31 +0000 (+0000) Subject: Small code tidy up in gv_fullname4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9dde0ab5b19ba4c8e14ce23a6ead155daca1526e;p=p5sagit%2Fp5-mst-13.2.git Small code tidy up in gv_fullname4 p4raw-id: //depot/perl@23605 --- diff --git a/gv.c b/gv.c index 5ea5141..64acb37 100644 --- a/gv.c +++ b/gv.c @@ -1092,13 +1092,12 @@ Perl_gv_fullname4(pTHX_ SV *sv, GV *gv, const char *prefix, bool keepmain) } sv_setpv(sv, prefix ? prefix : ""); - if (!HvNAME(hv)) + name = HvNAME(hv); + if (!name) name = "__ANON__"; - else - name = HvNAME(hv); + if (keepmain || strNE(name, "main")) { - sv_catpv(sv,name); - sv_catpvn(sv,"::", 2); + Perl_sv_catpvf(aTHX_ sv,"%s::", name); } sv_catpvn(sv,GvNAME(gv),GvNAMELEN(gv)); }