aboutsummaryrefslogtreecommitdiffstats
path: root/builtin.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2015-06-21 22:03:01 +0300
committerArnold D. Robbins <arnold@skeeve.com>2015-06-21 22:03:01 +0300
commitf57f0699d7193571233735ba691ba19fc072b7dc (patch)
tree324f8a3af40517cf6c345fafb8ae2a3e6c084658 /builtin.c
parent7c4eb55aea8028503a27cf0132de12257262f71a (diff)
downloadegawk-f57f0699d7193571233735ba691ba19fc072b7dc.tar.gz
egawk-f57f0699d7193571233735ba691ba19fc072b7dc.tar.bz2
egawk-f57f0699d7193571233735ba691ba19fc072b7dc.zip
Fix typeof to not change untyped param to scalar.
Diffstat (limited to 'builtin.c')
-rw-r--r--builtin.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/builtin.c b/builtin.c
index 61a4398b..942a36dd 100644
--- a/builtin.c
+++ b/builtin.c
@@ -3872,7 +3872,6 @@ do_typeof(int nargs)
{
NODE *arg;
char *res = "unknown";
- int null_str_flags = (STRCUR|STRING|NUMCUR|NUMBER);
arg = POP();
switch (arg->type) {
@@ -3884,7 +3883,7 @@ do_typeof(int nargs)
break;
case Node_val:
case Node_var:
- if ((arg->flags & null_str_flags) == null_str_flags)
+ if (arg == Nnull_string)
res = "untyped";
else if ((arg->flags & STRING) != 0)
res = "scalar_s";