diff options
author | John van Groningen | 2004-06-25 10:41:35 +0000 |
---|---|---|
committer | John van Groningen | 2004-06-25 10:41:35 +0000 |
commit | eb60a204c1b325838b740ecb623922c30b558d60 (patch) | |
tree | b8b0b83d314485860a869bb763881586259e6a94 | |
parent | detect EOF in file_read_string and file_read_line for redirected files and (diff) |
implement file_error for stdio
-rw-r--r-- | ufileIO2.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -940,8 +940,12 @@ int file_error (long fn) { if (fn<FIRST_REAL_FILE){ switch (fn){ - case 0: case 1: + if (ferror (stdin) || ferror (stdout)) + return -1; + else + return 0; + case 0: return 0; default: return -1; |