aboutsummaryrefslogtreecommitdiffstats
path: root/gawkapi.c
diff options
context:
space:
mode:
Diffstat (limited to 'gawkapi.c')
-rw-r--r--gawkapi.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gawkapi.c b/gawkapi.c
index b67275c1..cd09cddc 100644
--- a/gawkapi.c
+++ b/gawkapi.c
@@ -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;