Allow all kinds of string to be processed in open/4

This commit is contained in:
Adrián Arroyo Calle
2021-11-28 12:37:16 +01:00
parent ca28f24e42
commit 86161ccf2a
2 changed files with 8 additions and 25 deletions

View File

@@ -1475,7 +1475,11 @@ open(SourceSink, Mode, Stream, StreamOptions) :-
( SourceSink = stream(S0) ->
'$set_stream_options'(S0, Alias, EOFAction, Reposition, Type),
Stream = S0
; '$open'(SourceSink, Mode, Stream, Alias, EOFAction, Reposition, Type)
; (
atom(SourceSink) ->
atom_chars(SourceSink, SourceSinkString)
; SourceSink = SourceSinkString
), '$open'(SourceSinkString, Mode, Stream, Alias, EOFAction, Reposition, Type)
)
).