X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=hv.c;h=32503a9366c24aa866e72cbff0bff69259ae69ba;hb=b2b4ec814a5af6e0a2f7557c1a67c4b86af2f630;hp=06e3a47e9a4d3d5f94e92ed924afc002d8a0f10a;hpb=aec46f14fac1bc74bf8ad4054a6f9674b324f8d2;p=p5sagit%2Fp5-mst-13.2.git diff --git a/hv.c b/hv.c index 06e3a47..32503a9 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. */