aboutsummaryrefslogtreecommitdiffstats
path: root/builtin.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin.c')
-rw-r--r--builtin.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/builtin.c b/builtin.c
index f6fed878..4a99ed6f 100644
--- a/builtin.c
+++ b/builtin.c
@@ -3685,6 +3685,7 @@ do_typeof(int nargs)
{
NODE *arg;
char *res = "unknown";
+ int null_str_flags = (STRCUR|STRING|NUMCUR|NUMBER);
arg = POP();
switch (arg->type) {
@@ -3696,7 +3697,9 @@ do_typeof(int nargs)
break;
case Node_val:
case Node_var:
- if ((arg->flags & STRING) != 0)
+ if ((arg->flags & null_str_flags) == null_str_flags)
+ res = "untyped";
+ else if ((arg->flags & STRING) != 0)
res = "scalar_s";
else if ((arg->flags & NUMBER) != 0)
res = "scalar_n";