From 77db3d2545b713caa64e8b741af3a9aea13ddc34 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 6 Jul 2015 14:14:59 -0700 Subject: 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. --- ChangeLog | 8 ++++++++ stream.c | 5 +++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5f542085..caacc75a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2015-07-06 Kaz Kylheku + + 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 Clarify clear-error and flush return value. 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) -- cgit v1.2.3