aboutsummaryrefslogtreecommitdiffstats
path: root/builtin.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin.c')
-rw-r--r--builtin.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/builtin.c b/builtin.c
index e476ec99..1dd7dcbe 100644
--- a/builtin.c
+++ b/builtin.c
@@ -2144,7 +2144,9 @@ do_print(int nargs, int redirtype)
fatal(_("attempt to use array `%s' in a scalar context"), array_vname(tmp));
}
- if ((tmp->flags & (NUMBER|STRING)) == NUMBER) {
+ if (tmp->type == Node_typedregex)
+ args_array[i] = force_string(tmp);
+ else if ((tmp->flags & (NUMBER|STRING)) == NUMBER) {
if (OFMTidx == CONVFMTidx)
args_array[i] = force_string(tmp);
else
@@ -3877,11 +3879,14 @@ do_typeof(int nargs)
arg = POP();
switch (arg->type) {
case Node_var_array:
+ /* Node_var_array is never UPREF'ed */
res = "array";
deref = false;
break;
case Node_typedregex:
+ /* Op_push_re does not UPREF */
res = "regexp";
+ deref = false;
break;
case Node_val:
case Node_var:
@@ -3894,6 +3899,7 @@ do_typeof(int nargs)
break;
case Node_var_new:
res = "untyped";
+ deref = false;
break;
default:
fatal(_("typeof: unknown argument type `%s'"),