summaryrefslogtreecommitdiff
path: root/hv.c
diff options
context:
space:
mode:
authorJohn E. Malmberg <wb8tyw@qsl.net>2005-08-27 15:20:50 -0400
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2005-08-30 09:08:31 +0000
commit03026e68943709ca8a44f2b7298e79491a3245b9 (patch)
treebe402dc58983cf8903177ab07807aecf1129b833 /hv.c
parent9596c75cf25afc08d6274085fe826f0f50fd6c98 (diff)
downloadperl-03026e68943709ca8a44f2b7298e79491a3245b9.tar.gz
[patch@25334] hv.c vms environment fix.
From: "John E. Malmberg" <wb8tyw@qsl.net> Message-ID: <4310F552.8050401@qsl.net> p4raw-id: //depot/perl@25335
Diffstat (limited to 'hv.c')
-rw-r--r--hv.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/hv.c b/hv.c
index 06e3a47e9a..32503a9366 100644
--- a/hv.c
+++ b/hv.c
@@ -1983,8 +1983,17 @@ Perl_hv_iternext_flags(pTHX_ HV *hv, I32 flags)
return Null(HE*);
}
#ifdef DYNAMIC_ENV_FETCH /* set up %ENV for iteration */
- if (!entry && SvRMAGICAL((SV*)hv) && mg_find((SV*)hv, PERL_MAGIC_env))
+ if (!entry && SvRMAGICAL((SV*)hv) && mg_find((SV*)hv, PERL_MAGIC_env)) {
prime_env_iter();
+#ifdef VMS
+ /* The prime_env_iter() on VMS just loaded up new hash values
+ * so the iteration count needs to be reset back to the beginning
+ */
+ hv_iterinit(hv);
+ iter = HvAUX(hv);
+ oldentry = entry = iter->xhv_eiter; /* HvEITER(hv) */
+#endif
+ }
#endif
/* hv_iterint now ensures this. */