summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Siegal <jbs@eddie.mit.edu>1988-02-01 22:56:10 +0000
committerLarry Wall <lwall@jpl-devvax.jpl.nasa.gov>1988-02-01 22:56:10 +0000
commita4de7c03d0bdc29d9d3a18abad4ac2628182ed7b (patch)
tree5dc53383b9ae098b49ed81db24b316d5a82aaae4
parent2e1b3b7e9018b7d16d598adb631073672439d869 (diff)
downloadperl-a4de7c03d0bdc29d9d3a18abad4ac2628182ed7b.tar.gz
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.
-rw-r--r--patchlevel.h2
-rw-r--r--x2p/walk.c9
2 files changed, 7 insertions, 4 deletions
diff --git a/patchlevel.h b/patchlevel.h
index 910cae8f16..f95be0eb07 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 e81a9fd8de..1659e45f2d 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));