diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | gawkapi.c | 3 |
2 files changed, 9 insertions, 0 deletions
@@ -1,3 +1,9 @@ +2012-12-18 Andrew J. Schorr <aschorr@telemetry-investments.com> + + * gawkapi.c (sym_update_real): If setting a scalar variable that exists + already in an undefined state with type set to Node_var_new, we must + update the type to Node_var if the new value is not undefined. + 2012-12-18 Arnold D. Robbins <arnold@skeeve.com> * awkgram.y (tokentab): "extension" needs to be inside ifdef DYNAMIC. @@ -603,6 +603,9 @@ sym_update_real(awk_ext_id_t id, && (node->type == Node_var || node->type == Node_var_new)) { unref(node->var_value); node->var_value = awk_value_to_node(value); + if (node->type == Node_var_new && value->val_type != AWK_UNDEFINED) + node->type = Node_var; + /* let the extension change its own variable */ if (is_const) node->var_assign = set_constant; |