aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--gawkapi.c5
2 files changed, 10 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index ed4c2b9a..8d7f60a4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2014-11-09 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * gawkapi.c (node_to_awk_value): When the type wanted is AWK_UNDEFINED
+ and a it's a Node_val set to Nnull_string, return AWK_UNDEFINED instead
+ of AWK_NUMBER 0.
+
2014-11-03 Norihiro Tanaka <noritnk@kcn.ne.jp>
* re.c (research): Use dfa superset to improve matching speed.
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;