summaryrefslogtreecommitdiff
path: root/gawkapi.c
diff options
context:
space:
mode:
authorAndrew J. Schorr <aschorr@telemetry-investments.com>2016-06-14 15:14:37 -0400
committerAndrew J. Schorr <aschorr@telemetry-investments.com>2016-06-14 15:14:37 -0400
commite8ba153719506aabfffc911d2519727a3bfc5a36 (patch)
treec97ee6a4e909431437ed888f1a2e10b151d3056d /gawkapi.c
parentb54c54d30fe20cfb5f0794cd85eeec7783800866 (diff)
downloadgawk-e8ba153719506aabfffc911d2519727a3bfc5a36.tar.gz
Fix gawkapi node_to_awk_value to check scalar type correctly.
Diffstat (limited to 'gawkapi.c')
-rw-r--r--gawkapi.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gawkapi.c b/gawkapi.c
index b961f797..3d9f61a9 100644
--- a/gawkapi.c
+++ b/gawkapi.c
@@ -445,6 +445,7 @@ node_to_awk_value(NODE *node, awk_value_t *val, awk_valtype_t wanted)
break;
case AWK_SCALAR:
+ fixtype(node);
if ((node->flags & NUMBER) != 0) {
val->val_type = AWK_NUMBER;
} else if ((node->flags & STRING) != 0) {
@@ -456,6 +457,7 @@ node_to_awk_value(NODE *node, awk_value_t *val, awk_valtype_t wanted)
case AWK_UNDEFINED:
/* return true and actual type for request of undefined */
+ fixtype(node);
if (node == Nnull_string) {
val->val_type = AWK_UNDEFINED;
ret = awk_true;