another case of "read" --> "get", for an only internally used predicate

This commit is contained in:
Markus Triska
2023-06-24 11:48:28 +02:00
parent 18d0a74f23
commit 9bc3757a9e

View File

@@ -299,17 +299,17 @@ get_line_to_chars(Stream, Cs0, Cs) :-
get_n_chars(Stream, N, Cs) :- get_n_chars(Stream, N, Cs) :-
can_be(integer, N), can_be(integer, N),
( var(N) -> ( var(N) ->
read_to_eof(Stream, Cs), get_to_eof(Stream, Cs),
length(Cs, N) length(Cs, N)
; N >= 0, ; N >= 0,
'$get_n_chars'(Stream, N, Cs) '$get_n_chars'(Stream, N, Cs)
). ).
read_to_eof(Stream, Cs) :- get_to_eof(Stream, Cs) :-
'$get_n_chars'(Stream, 512, Cs0), '$get_n_chars'(Stream, 512, Cs0),
( Cs0 == [] -> Cs = [] ( Cs0 == [] -> Cs = []
; partial_string(Cs0, Cs, Rest), ; partial_string(Cs0, Cs, Rest),
read_to_eof(Stream, Rest) get_to_eof(Stream, Rest)
). ).
%% chars_base64(?Chars, ?Base64, +Options). %% chars_base64(?Chars, ?Base64, +Options).