aboutsummaryrefslogtreecommitdiffstats
path: root/builtin.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2016-07-23 21:59:40 +0300
committerArnold D. Robbins <arnold@skeeve.com>2016-07-23 21:59:40 +0300
commit140a4a886edc231f1c5f02c6cd4c82effe58139e (patch)
tree9b190ba921577201d6379cf73f81305d2d7990f8 /builtin.c
parent2a92e9d3cb8ba907376837dadd03abc6ad09b741 (diff)
downloadegawk-140a4a886edc231f1c5f02c6cd4c82effe58139e.tar.gz
egawk-140a4a886edc231f1c5f02c6cd4c82effe58139e.tar.bz2
egawk-140a4a886edc231f1c5f02c6cd4c82effe58139e.zip
Fix do_print for use with strnums.
Diffstat (limited to 'builtin.c')
-rw-r--r--builtin.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/builtin.c b/builtin.c
index 67424663..0163b81c 100644
--- a/builtin.c
+++ b/builtin.c
@@ -2179,12 +2179,8 @@ 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 (OFMTidx == CONVFMTidx)
- args_array[i] = force_string(tmp);
- else
- args_array[i] = format_val(OFMT, OFMTidx, tmp);
- }
+ if ((tmp->flags & STRCUR) == 0 || (tmp->stfmt != -1 && tmp->stfmt != OFMTidx))
+ args_array[i] = format_val(OFMT, OFMTidx, tmp);
}
if (redir_exp != NULL) {