summaryrefslogtreecommitdiff
path: root/gawkapi.c
diff options
context:
space:
mode:
authorAndrew J. Schorr <aschorr@telemetry-investments.com>2014-11-09 09:27:07 -0500
committerAndrew J. Schorr <aschorr@telemetry-investments.com>2014-11-09 09:27:07 -0500
commit0ea9121e4bf07514d75024837fe4dd1c615c8ec0 (patch)
tree5079c326f3e17882fc0062be393ccd9b47c2b3b0 /gawkapi.c
parent50925902635e9b66288318fd768157dbeb529f08 (diff)
downloadgawk-0ea9121e4bf07514d75024837fe4dd1c615c8ec0.tar.gz
Fix api to treat an uninitialized value as AWK_UNDEFINED.
Diffstat (limited to 'gawkapi.c')
-rw-r--r--gawkapi.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gawkapi.c b/gawkapi.c
index bcf8d90a..06f31929 100644
--- a/gawkapi.c
+++ b/gawkapi.c
@@ -441,7 +441,10 @@ 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 */
- if ((node->flags & NUMBER) != 0) {
+ if (node == Nnull_string) {
+ val->val_type = AWK_UNDEFINED;
+ ret = awk_true;
+ } else if ((node->flags & NUMBER) != 0) {
val->val_type = AWK_NUMBER;
val->num_value = get_number_d(node);
ret = awk_true;