diff options
author | Andrew J. Schorr <aschorr@telemetry-investments.com> | 2014-11-09 09:27:07 -0500 |
---|---|---|
committer | Andrew J. Schorr <aschorr@telemetry-investments.com> | 2014-11-09 09:27:07 -0500 |
commit | 0ea9121e4bf07514d75024837fe4dd1c615c8ec0 (patch) | |
tree | 5079c326f3e17882fc0062be393ccd9b47c2b3b0 /gawkapi.c | |
parent | 50925902635e9b66288318fd768157dbeb529f08 (diff) | |
download | gawk-0ea9121e4bf07514d75024837fe4dd1c615c8ec0.tar.gz |
Fix api to treat an uninitialized value as AWK_UNDEFINED.
Diffstat (limited to 'gawkapi.c')
-rw-r--r-- | gawkapi.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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; |