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:
		@@ -2839,9 +2839,6 @@ p_read (void)
 | 
				
			|||||||
  if (Stream[c_input_stream].status & Binary_Stream_f) {
 | 
					  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");
 | 
					    Error(PERMISSION_ERROR_INPUT_BINARY_STREAM, MkAtomTerm(Stream[c_input_stream].u.file.name), "read_term/2");
 | 
				
			||||||
    return(FALSE);
 | 
					    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;
 | 
					  old_TR = TR;
 | 
				
			||||||
  while (TRUE) {
 | 
					  while (TRUE) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -24,7 +24,7 @@ open(Source,M,T) :- var(M), !,
 | 
				
			|||||||
open(Source,M,T) :- nonvar(T), !,
 | 
					open(Source,M,T) :- nonvar(T), !,
 | 
				
			||||||
	'$do_error'(type_error(variable,T),open(Source,M,T)).
 | 
						'$do_error'(type_error(variable,T),open(Source,M,T)).
 | 
				
			||||||
open(File,Mode,Stream) :-
 | 
					open(File,Mode,Stream) :-
 | 
				
			||||||
	'$open'(File,Mode,Stream,0).
 | 
						'$open'(File,Mode,Stream,16).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* meaning of flags for '$write' is
 | 
					/* meaning of flags for '$write' is
 | 
				
			||||||
	 1	quote illegal atoms
 | 
						 1	quote illegal atoms
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user