From eb261daff5e9a96f294cd806d1fd3e68f06fdbaa Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Wed, 6 Jul 2016 22:29:58 -0400 Subject: Modify MAYBE_NUM usage and typeof function to return "strnum" only for actual numeric strings. --- builtin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'builtin.c') 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: -- cgit v1.2.3