aboutsummaryrefslogtreecommitdiffstats
path: root/builtin.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin.c')
-rw-r--r--builtin.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/builtin.c b/builtin.c
index 77cf3fc5..da3c252f 100644
--- a/builtin.c
+++ b/builtin.c
@@ -2200,13 +2200,7 @@ do_print(int nargs, int redirtype)
DEREF(args_array[i]);
fatal(_("attempt to use array `%s' in a scalar context"), array_vname(tmp));
}
-
- if (tmp->type == Node_typedregex)
- args_array[i] = force_string(tmp);
- else if ( (tmp->flags & STRCUR) == 0
- || ( tmp->stfmt != STFMT_UNUSED
- && tmp->stfmt != OFMTidx))
- args_array[i] = format_val(OFMT, OFMTidx, tmp);
+ args_array[i] = force_string_ofmt(tmp);
}
if (redir_exp != NULL) {
@@ -3963,14 +3957,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: