summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-07-06 14:14:59 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-07-06 14:14:59 -0700
commit77db3d2545b713caa64e8b741af3a9aea13ddc34 (patch)
tree86c1ba45687c57c6ff7f595453b964077df903a0
parent567baab047c82c17c7e3d5a16dc508b5abf6cd25 (diff)
downloadtxr-77db3d2545b713caa64e8b741af3a9aea13ddc34.tar.gz
txr-77db3d2545b713caa64e8b741af3a9aea13ddc34.tar.bz2
txr-77db3d2545b713caa64e8b741af3a9aea13ddc34.zip
Bugfix in printed rep of stdio stream.
* stream.c (stdio_stream_print): Wrong way test on h->pid; if it is nonzero it must be printed. Was printed wrong: argument of integer type passed to ~s which expects a val.
-rw-r--r--ChangeLog8
-rw-r--r--stream.c5
2 files changed, 11 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 5f542085..caacc75a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
2015-07-06 Kaz Kylheku <kaz@kylheku.com>
+ Bugfix in printed rep of stdio stream.
+
+ * stream.c (stdio_stream_print): Wrong way test on h->pid;
+ if it is nonzero it must be printed. Was printed wrong:
+ argument of integer type passed to ~s which expects a val.
+
+2015-07-06 Kaz Kylheku <kaz@kylheku.com>
+
Clarify clear-error and flush return value.
* stream.c (stdio_clear_error): Return the prior value of h->err.
diff --git a/stream.c b/stream.c
index e0bf5bd8..5f4fcc3f 100644
--- a/stream.c
+++ b/stream.c
@@ -276,9 +276,10 @@ static void stdio_stream_print(val stream, val out)
{
struct stdio_handle *h = coerce(struct stdio_handle *, stream->co.handle);
if (h->pid)
- format(out, lit("#<~s ~s>"), stream->co.cls, h->descr, nao);
+ format(out, lit("#<~s ~s ~s>"), stream->co.cls, h->descr,
+ num(h->pid), nao);
else
- format(out, lit("#<~s ~s ~s>"), stream->co.cls, h->descr, h->pid, nao);
+ format(out, lit("#<~s ~s>"), stream->co.cls, h->descr, nao);
}
static void stdio_stream_destroy(val stream)