summaryrefslogtreecommitdiff
path: root/hv.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2003-11-24 20:07:29 +0000
committerNicholas Clark <nick@ccl4.org>2003-11-24 20:07:29 +0000
commit0ed299501d408b6e22065c36966752a861574a3d (patch)
tree087f895d0920579a53e768a1947616b9dfcdf2f7 /hv.c
parentab4af70554602b5bde7d5593a6100e1d2b9582a0 (diff)
downloadperl-0ed299501d408b6e22065c36966752a861574a3d.tar.gz
Should fix the infinite loop on a dynamic %ENV fetch
p4raw-id: //depot/perl@21782
Diffstat (limited to 'hv.c')
-rw-r--r--hv.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hv.c b/hv.c
index a39fdcdc71..39684b0808 100644
--- a/hv.c
+++ b/hv.c
@@ -682,7 +682,8 @@ S_hv_fetch_common(pTHX_ HV *hv, SV *keysv, const char *key, STRLEN klen,
return entry;
}
#ifdef DYNAMIC_ENV_FETCH /* %ENV lookup? If so, try to fetch the value now */
- if (SvRMAGICAL((SV*)hv) && mg_find((SV*)hv, PERL_MAGIC_env)) {
+ if (!(action & HV_FETCH_ISSTORE)
+ && SvRMAGICAL((SV*)hv) && mg_find((SV*)hv, PERL_MAGIC_env)) {
unsigned long len;
char *env = PerlEnv_ENVgetenv_len(key,&len);
if (env) {