fix existing-stream ase for with_output_to/2

This commit is contained in:
Vitor Santos Costa 2016-08-01 13:20:00 -05:00
parent 81c00f9736
commit 957aa9f977

View File

@ -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;