perl 1.0 patch 14: a2p incorrectly translates 'for (a in b)' construct.
authorJeff Siegal <jbs@eddie.mit.edu>
Mon, 1 Feb 1988 22:56:10 +0000 (22:56 +0000)
committerLarry Wall <lwall@jpl-devvax.jpl.nasa.gov>
Mon, 1 Feb 1988 22:56:10 +0000 (22:56 +0000)
The code a2p creates for the 'for (a in b)' construct ends
up assigning the wrong value to the key variable.

patchlevel.h
x2p/walk.c

index 910cae8..f95be0e 100644 (file)
@@ -1 +1 @@
-#define PATCHLEVEL 13
+#define PATCHLEVEL 14
index e81a9fd..1659e45 100644 (file)
@@ -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));