From 47b1e98272b677ef4ee70a0c5cf9a4578d04277a Mon Sep 17 00:00:00 2001 From: Erik Bray Date: Thu, 9 Feb 2017 17:15:06 +0000 Subject: [PATCH] In `flisten` check that the stream is not in an error state, as well as not eof (The latter doesn't necessarily imply the former) --- src/c/file.d | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/c/file.d b/src/c/file.d index 0f739b0c7..21224858a 100755 --- a/src/c/file.d +++ b/src/c/file.d @@ -5314,7 +5314,7 @@ static int flisten(cl_object stream, FILE *fp) { int aux; - if (feof(fp)) + if (feof(fp) || ferror(fp)) return ECL_LISTEN_EOF; #ifdef FILE_CNT if (FILE_CNT(fp) > 0)