summaryrefslogtreecommitdiffstats
path: root/stream.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2012-08-31 14:58:21 -0700
committerKaz Kylheku <kaz@kylheku.com>2012-08-31 14:58:21 -0700
commitaf11cf8971267c7e44c400477383d5fa8acf9771 (patch)
tree957c1e6b383a16ad3ff6b717ea95f04c2fd096bd /stream.c
parent7a4304462d4004d51f748ed83bb9e7dcd6a958cd (diff)
downloadtxr-af11cf8971267c7e44c400477383d5fa8acf9771.tar.gz
txr-af11cf8971267c7e44c400477383d5fa8acf9771.tar.bz2
txr-af11cf8971267c7e44c400477383d5fa8acf9771.zip
* stream.c (vformat): Bugfix: under the ~a and ~s directives,
apply field formatting to the object not only if a nonzero width has been specified, but also if precision has been specified. * txr.1: documented stream global variables and format.
Diffstat (limited to 'stream.c')
-rw-r--r--stream.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/stream.c b/stream.c
index dce01c15..8d37bc72 100644
--- a/stream.c
+++ b/stream.c
@@ -1285,7 +1285,7 @@ val vformat(val stream, val fmtstr, va_list vl)
precision = 0;
goto output_num;
default:
- if (width != 0) {
+ if (width != 0 || precision_p) {
val str = format(nil, ch == 'a' ? lit("~a") : lit("~s"),
obj, nao);
if (!vformat_str(stream, str, width, left, precision))