make open/3 complain when trying to read after end of file.

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@590 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc 2002-09-16 16:57:27 +00:00
parent 4b88cd24f9
commit cf6391d96b
2 changed files with 1 additions and 4 deletions

View File

@ -2839,9 +2839,6 @@ p_read (void)
if (Stream[c_input_stream].status & Binary_Stream_f) {
Error(PERMISSION_ERROR_INPUT_BINARY_STREAM, MkAtomTerm(Stream[c_input_stream].u.file.name), "read_term/2");
return(FALSE);
} else if (Stream[c_input_stream].status & Eof_Error_Stream_f) {
Error(PERMISSION_ERROR_INPUT_PAST_END_OF_STREAM, MkAtomTerm(Stream[c_input_stream].u.file.name), "read_term/2");
return(FALSE);
}
old_TR = TR;
while (TRUE) {

View File

@ -24,7 +24,7 @@ open(Source,M,T) :- var(M), !,
open(Source,M,T) :- nonvar(T), !,
'$do_error'(type_error(variable,T),open(Source,M,T)).
open(File,Mode,Stream) :-
'$open'(File,Mode,Stream,0).
'$open'(File,Mode,Stream,16).
/* meaning of flags for '$write' is
1 quote illegal atoms