`term_string/2` returns `end_of_file` with null string at the second arg

Thanks. I have checked that prolog cgi pages of mine now works as expected with respect to the new “end_of_file” syntax error for term_string.

However, I notice that we still see end_of_file or -1 for queries like below. As there is prepared ‘at_end_of_stream/0,1’ IMHO, it seems better to hide such “end_of_file” marks from the user. I know -1 has been used since Edinburgh Prolog. So I understand such explicit but artificial end_of_file terms are mainly from historical reasons, I guess, but I may be wrong.

?- open_string("",  S), get_code(S, C), close(S).
S = <stream>(0x600001ee8000),
C = -1.

?- open_string("",  S), at_end_of_stream(S), close(S).
S = <stream>(0x600001e72000).

?- open_string("",  S), at_end_of_stream(S), read(S, X), close(S).
S = <stream>(0x600001ef7100),
X = end_of_file.