diff options
| author | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2006-01-06 01:39:34 +0000 |
|---|---|---|
| committer | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2006-01-06 01:39:34 +0000 |
| commit | 9696b2257cfc61d3e04045f05cc37580e461d0ef (patch) | |
| tree | 1b49be523e21bb74b123b6ac069be07266b1e925 /libgfortran/io/transfer.c | |
| parent | 5c1fac10027111f60694aca0dd7f1103b09ae865 (diff) | |
| download | gcc-9696b2257cfc61d3e04045f05cc37580e461d0ef.zip gcc-9696b2257cfc61d3e04045f05cc37580e461d0ef.tar.gz gcc-9696b2257cfc61d3e04045f05cc37580e461d0ef.tar.bz2 | |
re PR libfortran/25598 (gfortran - Fortran runtime error: Invalid argument)
2006-01-05 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/25598
* io/file_pos.c (unformatted_backspace): Assure the new file position
to seek is not less than zero.
(st_backspace): Set unit bytes_left to zero.
* io/transfer.c (next_record_r): Fix line lengths, no functional change.
From-SVN: r109405
Diffstat (limited to 'libgfortran/io/transfer.c')
| -rw-r--r-- | libgfortran/io/transfer.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c index 2c12294..049ebb2 100644 --- a/libgfortran/io/transfer.c +++ b/libgfortran/io/transfer.c @@ -1645,8 +1645,10 @@ next_record_r (st_parameter_dt *dtp) switch (current_mode (dtp)) { case UNFORMATTED_SEQUENTIAL: - dtp->u.p.current_unit->bytes_left += sizeof (gfc_offset); /* Skip over tail */ + /* Skip over tail */ + dtp->u.p.current_unit->bytes_left += sizeof (gfc_offset); + /* Fall through... */ case FORMATTED_DIRECT: @@ -1656,7 +1658,8 @@ next_record_r (st_parameter_dt *dtp) if (is_seekable (dtp->u.p.current_unit->s)) { - new = file_position (dtp->u.p.current_unit->s) + dtp->u.p.current_unit->bytes_left; + new = file_position (dtp->u.p.current_unit->s) + + dtp->u.p.current_unit->bytes_left; /* Direct access files do not generate END conditions, only I/O errors. */ |
