summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbhijit Menon-Sen <ams@wiw.org>2001-10-11 03:29:33 +0530
committerAbhijit Menon-Sen <ams@wiw.org>2001-10-10 16:09:53 +0000
commitecfc864712c3adc100dc5f6f36fc5dfc21c6f29b (patch)
tree2489327c5d56f25ca39bc37a4ed942c85af1c04d
parentbcd0738c9a444b4576eed7823f5bfdff557d5a51 (diff)
downloadperl-ecfc864712c3adc100dc5f6f36fc5dfc21c6f29b.tar.gz
Re: /usr/include/sys/e ?? (perl@12340)
Message-Id: <20011010215933.B2444@lustre.dyn.wiw.org> p4raw-id: //depot/perl@12394
-rw-r--r--ext/Data/Dumper/Dumper.xs14
1 files changed, 8 insertions, 6 deletions
diff --git a/ext/Data/Dumper/Dumper.xs b/ext/Data/Dumper/Dumper.xs
index d0eb917b58..1b6aeca17a 100644
--- a/ext/Data/Dumper/Dumper.xs
+++ b/ext/Data/Dumper/Dumper.xs
@@ -531,15 +531,19 @@ DD_dump(pTHX_ SV *val, char *name, STRLEN namelen, SV *retval, HV *seenhv,
}
else
(void)hv_iterinit((HV*)ival);
- i = 0;
- while (sortkeys ? (void*)(keys && (i <= av_len(keys))) :
- (void*)((entry = hv_iternext((HV*)ival))) ) {
+
+ /* foreach (keys %hash) */
+ for (i = 0; 1; i++) {
char *nkey = NULL;
I32 nticks = 0;
SV* keysv;
STRLEN keylen;
bool do_utf8 = FALSE;
-
+
+ if ((sortkeys && !(keys && i <= av_len(keys))) ||
+ !(entry = hv_iternext((HV *)ival)))
+ break;
+
if (i)
sv_catpvn(retval, ",", 1);
@@ -556,8 +560,6 @@ DD_dump(pTHX_ SV *val, char *name, STRLEN namelen, SV *retval, HV *seenhv,
hval = hv_iterval((HV*)ival, entry);
}
- i++;
-
do_utf8 = DO_UTF8(keysv);
key = SvPV(keysv, keylen);
klen = keylen;