protect against crashes in bad user code

This commit is contained in:
Vítor Santos Costa
2015-03-11 22:23:31 +00:00
parent 04ff7f3f2d
commit 7cceb655b3
3 changed files with 6 additions and 5 deletions

View File

@@ -206,7 +206,7 @@ empty. As an example, consider:
~~~~~{.prolog}
?- fields("Hello I am free"," *",S).
S = ["Hello","","I","am","","free"] ?
S = ["Hello","","I","am","","free"] ?
~~~~~
*/
fields(String, FieldsCodes, Strings) :-
@@ -275,6 +275,7 @@ filter(StreamInp, StreamOut, Command) :-
!
;
call(Command, Line, NewLine),
ground(NewLine),
format(StreamOut, '~s~n', [NewLine]),
fail
).