diff options
author | Andrew J. Schorr <aschorr@telemetry-investments.com> | 2016-06-14 15:14:37 -0400 |
---|---|---|
committer | Andrew J. Schorr <aschorr@telemetry-investments.com> | 2016-06-14 15:14:37 -0400 |
commit | e8ba153719506aabfffc911d2519727a3bfc5a36 (patch) | |
tree | c97ee6a4e909431437ed888f1a2e10b151d3056d | |
parent | b54c54d30fe20cfb5f0794cd85eeec7783800866 (diff) | |
download | egawk-e8ba153719506aabfffc911d2519727a3bfc5a36.tar.gz egawk-e8ba153719506aabfffc911d2519727a3bfc5a36.tar.bz2 egawk-e8ba153719506aabfffc911d2519727a3bfc5a36.zip |
Fix gawkapi node_to_awk_value to check scalar type correctly.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | gawkapi.c | 2 |
2 files changed, 7 insertions, 0 deletions
@@ -1,3 +1,8 @@ +2016-06-14 Andrew J. Schorr <aschorr@telemetry-investments.com> + + * gawkapi.c (node_to_awk_value): When caller requests AWK_SCALAR + or AWK_UNDEFINED, we need to call fixtype before we check the type. + 2016-06-13 Andrew J. Schorr <aschorr@telemetry-investments.com> * awkgram.y: Eliminate STRCUR tests. Must use STRING to test whether @@ -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; |