summaryrefslogtreecommitdiffstats
path: root/stream.c
diff options
context:
space:
mode:
Diffstat (limited to 'stream.c')
-rw-r--r--stream.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/stream.c b/stream.c
index 023e8390..64380b87 100644
--- a/stream.c
+++ b/stream.c
@@ -45,6 +45,7 @@
#include "utf8.h"
val std_input, std_output, std_error;
+val output_produced;
struct strm_ops {
struct cobj_ops cobj_ops;
@@ -124,6 +125,9 @@ static val stdio_put_string(val stream, val str)
{
struct stdio_handle *h = (struct stdio_handle *) stream->co.handle;
+ if (h->f == stdout)
+ output_produced = t;
+
if (h->f != 0) {
const wchar_t *s = c_str(str);
while (*s) {
@@ -138,6 +142,8 @@ static val stdio_put_string(val stream, val str)
static val stdio_put_char(val stream, val ch)
{
struct stdio_handle *h = (struct stdio_handle *) stream->co.handle;
+ if (h->f == stdout)
+ output_produced = t;
return h->f != 0 && utf8_encode(c_chr(ch), stdio_put_char_callback, (mem_t *) h->f)
? t : stdio_maybe_write_error(stream);
}