From 957aa9f977a9c01c6330e45c0ed1b921ac7de0c0 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Mon, 1 Aug 2016 13:20:00 -0500 Subject: [PATCH] fix existing-stream ase for with_output_to/2 --- os/format.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/os/format.c b/os/format.c index fd1003976..cb8f68b8d 100644 --- a/os/format.c +++ b/os/format.c @@ -1210,10 +1210,11 @@ static Int with_output_to(USES_REGS1) { (f == FunctorAtom || f == FunctorString || f == FunctorCodes1 || f == FunctorCodes || f == FunctorChars1 || f == FunctorChars)) { output_stream = Yap_OpenBufWriteStream(PASS_REGS1); - mem_stream = true; + my_mem_stream = true; } else { /* needs to change LOCAL_c_output_stream for write */ output_stream = Yap_CheckStream(ARG1, Output_Stream_f, "format/3"); + my_mem_stream = false; } if (output_stream == -1) { return false;