aboutsummaryrefslogtreecommitdiffstats
path: root/gawkapi.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2013-07-04 11:59:09 +0300
committerArnold D. Robbins <arnold@skeeve.com>2013-07-04 11:59:09 +0300
commitb9a7f4a3512f770fe86be8f32d32642b6ff95bb3 (patch)
tree9dcfe918b9c32eba2108777309a2729c0cf19540 /gawkapi.c
parentddd5dad408190860cb362ddef5944f90284b565b (diff)
parent133125e373eebdd96cfe5ed54951d2770c01ef7d (diff)
downloadegawk-b9a7f4a3512f770fe86be8f32d32642b6ff95bb3.tar.gz
egawk-b9a7f4a3512f770fe86be8f32d32642b6ff95bb3.tar.bz2
egawk-b9a7f4a3512f770fe86be8f32d32642b6ff95bb3.zip
Merge branch 'gawk-4.1-stable'
Diffstat (limited to 'gawkapi.c')
-rw-r--r--gawkapi.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/gawkapi.c b/gawkapi.c
index 61f91e8c..9936d530 100644
--- a/gawkapi.c
+++ b/gawkapi.c
@@ -934,12 +934,17 @@ api_flatten_array(awk_ext_id_t id,
for (i = j = 0; i < 2 * array->table_size; i += 2, j++) {
NODE *index, *value;
- index = force_string(list[i]);
+ index = list[i];
value = list[i + 1]; /* number or string or subarray */
- /* convert index and value to ext types */
+ /*
+ * Convert index and value to ext types. Force the
+ * index to be a string, since indices are always
+ * conceptually strings, regardless of internal optimizations
+ * to treat them as integers in some cases.
+ */
if (! node_to_awk_value(index,
- & (*data)->elements[j].index, AWK_UNDEFINED)) {
+ & (*data)->elements[j].index, AWK_STRING)) {
fatal(_("api_flatten_array: could not convert index %d\n"),
(int) i);
}