diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2001-09-29 00:18:13 +0200 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-09-28 22:21:55 +0000 |
commit | d3a4e64e0737f054931b8b9fa88a25b20bbdd085 (patch) | |
tree | 6b24426722af0994ad9adce4e3b994d2ebf92fcb | |
parent | a0e22bad6f47247731c8fdba536bf313db3ccf4e (diff) | |
download | perl-d3a4e64e0737f054931b8b9fa88a25b20bbdd085.tar.gz |
Allow an @INC hook to set %INC
Message-ID: <20010928221813.A16889@rafael>
p4raw-id: //depot/perl@12260
-rw-r--r-- | pp_ctl.c | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -3323,10 +3323,14 @@ trylocal: { SETERRNO(0, SS$_NORMAL); /* Assume success here to prevent recursive requirement. */ - (void)hv_store(GvHVn(PL_incgv), name, strlen(name), - (hook_sv ? SvREFCNT_inc(hook_sv) - : newSVpv(CopFILE(&PL_compiling), 0)), - 0 ); + len = strlen(name); + /* Check whether a hook in @INC has already filled %INC */ + if (!hook_sv || !(svp = hv_fetch(GvHVn(PL_incgv), name, len, 0))) { + (void)hv_store(GvHVn(PL_incgv), name, len, + (hook_sv ? SvREFCNT_inc(hook_sv) + : newSVpv(CopFILE(&PL_compiling), 0)), + 0 ); + } ENTER; SAVETMPS; |