diff options
Diffstat (limited to 'libgfortran/io')
-rw-r--r-- | libgfortran/io/list_read.c | 13 | ||||
-rw-r--r-- | libgfortran/io/unix.c | 3 |
2 files changed, 11 insertions, 5 deletions
diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c index 8b00a5e..f47d473 100644 --- a/libgfortran/io/list_read.c +++ b/libgfortran/io/list_read.c @@ -142,8 +142,17 @@ next_char (void) } if (length == 0) - longjmp (g.eof_jump, 1); - c = *p; + { + /* For internal files return a newline instead of signalling EOF. */ + /* ??? This isn't quite right, but we don't handle internal files + with multiple records. */ + if (is_internal_unit ()) + c = '\n'; + else + longjmp (g.eof_jump, 1); + } + else + c = *p; done: at_eol = (c == '\n'); diff --git a/libgfortran/io/unix.c b/libgfortran/io/unix.c index 33d7fda..377cadd 100644 --- a/libgfortran/io/unix.c +++ b/libgfortran/io/unix.c @@ -746,9 +746,6 @@ mem_alloc_r_at (unix_stream * s, int *len, gfc_offset where) if (where < s->buffer_offset || where > s->buffer_offset + s->active) return NULL; - if (is_internal_unit() && where + *len > s->file_length) - return NULL; - s->logical_offset = where + *len; n = s->buffer_offset + s->active - where; |