aboutsummaryrefslogtreecommitdiffstats
path: root/interpret.h
diff options
context:
space:
mode:
authorjohn haque <j.eh@mchsi.com>2012-04-21 05:52:19 -0500
committerjohn haque <j.eh@mchsi.com>2012-04-21 05:52:19 -0500
commit1a4aaf18f5ec6149315aabc53dbe667f1abfdb62 (patch)
tree5c7ad893e1621b7006566f31d8d16707a0258436 /interpret.h
parent87dc23679566c5ad96f4869de6aec39c2a4c3aa7 (diff)
downloadegawk-1a4aaf18f5ec6149315aabc53dbe667f1abfdb62.tar.gz
egawk-1a4aaf18f5ec6149315aabc53dbe667f1abfdb62.tar.bz2
egawk-1a4aaf18f5ec6149315aabc53dbe667f1abfdb62.zip
Add optional shutdown routine for an extension lib.
Diffstat (limited to 'interpret.h')
-rw-r--r--interpret.h11
1 files changed, 4 insertions, 7 deletions
diff --git a/interpret.h b/interpret.h
index 0b830010..2fed2243 100644
--- a/interpret.h
+++ b/interpret.h
@@ -106,6 +106,8 @@ top:
*/
if (stdio_problem && ! exiting && exit_val == 0)
exit_val = 1;
+
+ close_extensions();
}
break;
@@ -763,12 +765,6 @@ mod:
/* get the array */
array = POP_ARRAY();
- /* sanity: check if empty */
- if (assoc_empty(array))
- goto arrayfor;
-
- num_elems = array->table_size;
-
if (sorted_in == NULL) /* do this once */
sorted_in = make_string("sorted_in", 9);
@@ -788,7 +784,8 @@ mod:
list = assoc_list(array, how_to_sort, SORTED_IN);
-arrayfor:
+ num_elems = assoc_length(array);
+
getnode(r);
r->type = Node_arrayfor;
r->for_list = list;