summaryrefslogtreecommitdiff
path: root/builtin.c
diff options
context:
space:
mode:
authorAndrew J. Schorr <aschorr@telemetry-investments.com>2016-07-06 22:29:58 -0400
committerAndrew J. Schorr <aschorr@telemetry-investments.com>2016-07-06 22:29:58 -0400
commiteb261daff5e9a96f294cd806d1fd3e68f06fdbaa (patch)
tree5f4d05861ac492c52a9f6a0781c69e90be73b60c /builtin.c
parentce342a04922797cb53557178c54d32c4efafda16 (diff)
downloadgawk-eb261daff5e9a96f294cd806d1fd3e68f06fdbaa.tar.gz
Modify MAYBE_NUM usage and typeof function to return "strnum" only for actual numeric strings.
Diffstat (limited to 'builtin.c')
-rw-r--r--builtin.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin.c b/builtin.c
index a21df18e..032f0ec7 100644
--- a/builtin.c
+++ b/builtin.c
@@ -3951,14 +3951,14 @@ do_typeof(int nargs)
break;
case Node_val:
case Node_var:
- switch (arg->flags & (STRING|NUMBER|MAYBE_NUM)) {
+ switch (fixtype(arg)->flags & (STRING|NUMBER|MAYBE_NUM)) {
case STRING:
res = "string";
break;
case NUMBER:
res = "number";
break;
- case STRING|MAYBE_NUM:
+ case NUMBER|MAYBE_NUM:
res = "strnum";
break;
case NUMBER|STRING: