diff options
author | Nicholas Clark <nick@ccl4.org> | 2006-02-21 20:09:25 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2006-02-21 20:09:25 +0000 |
commit | fd13b0dcd66223c4c2556f134a38b299c80ace69 (patch) | |
tree | 9b50640a8dead1223c70c845f5ebb532c32240bb /mg.c | |
parent | 7a77f1af173fb7e6eb60fad332fc8a27d67c5ab6 (diff) | |
download | perl-fd13b0dcd66223c4c2556f134a38b299c80ace69.tar.gz |
Can merge the two arms of Perl_magic_getglob to save space.
p4raw-id: //depot/perl@27265
Diffstat (limited to 'mg.c')
-rw-r--r-- | mg.c | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -1839,14 +1839,15 @@ Perl_magic_setpos(pTHX_ SV *sv, MAGIC *mg) int Perl_magic_getglob(pTHX_ SV *sv, MAGIC *mg) { + const U32 wasfake = SvFLAGS(sv) & SVf_FAKE; PERL_UNUSED_ARG(mg); - if (SvFAKE(sv)) { /* FAKE globs can get coerced */ - SvFAKE_off(sv); - gv_efullname3(sv,((GV*)sv), "*"); - SvFAKE_on(sv); - } - else - gv_efullname3(sv,((GV*)sv), "*"); /* a gv value, be nice */ + + /* FAKE globs can get coerced, so need to turn this off temporarily if it + is on. */ + SvFAKE_off(sv); + gv_efullname3(sv,((GV*)sv), "*"); + SvFLAGS(sv) |= wasfake; + return 0; } |