[m-rev.] diff: Fix write_line/4 and write_line/5 writing to the wrong stream.
Peter Wang
novalazy at gmail.com
Thu Sep 29 16:28:31 AEST 2016
library/io.m:
Fix write_line/4 and write_line/5 writing newline to the current
output stream instead of the specified stream.
---
library/io.m | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/library/io.m b/library/io.m
index 52bfc63..fa2bdd2 100644
--- a/library/io.m
+++ b/library/io.m
@@ -4892,16 +4892,16 @@ write_cc(X, !IO) :-
stream.string_writer.write(Stream, include_details_cc, X, !IO).
write_line(X, !IO) :-
- io.write(X, !IO),
- io.nl(!IO).
+ output_stream(Stream, !IO),
+ write_line(Stream, X, !IO).
write_line(Stream, X, !IO) :-
io.write(Stream, X, !IO),
- io.nl(!IO).
+ io.nl(Stream, !IO).
write_line(Stream, NonCanon, X, !IO) :-
io.write(Stream, NonCanon, X, !IO),
- io.nl(!IO).
+ io.nl(Stream, !IO).
write_line_cc(X, !IO) :-
io.write_cc(X, !IO),
--
2.9.0
More information about the reviews
mailing list