From: Jeff Siegal Date: Mon, 1 Feb 1988 22:56:10 +0000 (+0000) Subject: perl 1.0 patch 14: a2p incorrectly translates 'for (a in b)' construct. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a4de7c03d0bdc29d9d3a18abad4ac2628182ed7b;p=p5sagit%2Fp5-mst-13.2.git perl 1.0 patch 14: a2p incorrectly translates 'for (a in b)' construct. The code a2p creates for the 'for (a in b)' construct ends up assigning the wrong value to the key variable. --- diff --git a/patchlevel.h b/patchlevel.h index 910cae8..f95be0e 100644 --- a/patchlevel.h +++ b/patchlevel.h @@ -1 +1 @@ -#define PATCHLEVEL 13 +#define PATCHLEVEL 14 diff --git a/x2p/walk.c b/x2p/walk.c index e81a9fd..1659e45 100644 --- a/x2p/walk.c +++ b/x2p/walk.c @@ -1,6 +1,9 @@ -/* $Header: walk.c,v 1.0.1.2 88/02/01 17:34:05 root Exp $ +/* $Header: walk.c,v 1.0.1.3 88/02/02 11:54:58 root Exp $ * * $Log: walk.c,v $ + * Revision 1.0.1.3 88/02/02 11:54:58 root + * patch14: got return value of each() backwards in translating 'for (a in b)'. + * * Revision 1.0.1.2 88/02/01 17:34:05 root * patch12: made a2p take advantage of new awk-compatible split in perl. * @@ -962,10 +965,10 @@ sub Pick {\n\ str_free(fstr); } else { - str_set(str,"while (($junkkey,$"); + str_set(str,"while (($"); str_scat(str,fstr=walk(1,level,ops[node+1].ival,&numarg)); str_free(fstr); - str_cat(str,") = each("); + str_cat(str,",$junkval) = each("); str_scat(str,tmpstr); str_cat(str,")) "); str_scat(str,fstr=walk(0,level,ops[node+3].ival,&numarg));