re PR libfortran/18398 (Formatted I/O problems)

2005-01-07  Bud Davis  <bdavis9659@comcast.net>

        PR fortran/18398
        * transfer.c (next_record_r): always skip the
        eol search if it was found during sf_read.

        * gfortran.dg/fmt_read.f90: New test.

From-SVN: r93035
This commit is contained in:
Bud Davis 2005-01-07 03:25:47 +00:00 committed by Bud Davis
parent 9fb29c4634
commit a7e8d7dbe7
4 changed files with 24 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2005-01-07 Bud Davis <bdavis9659@comcast.net>
PR fortran/18398
* gfortran.dg/fmt_read.f90: New test.
2005-01-06 Geoffrey Keating <geoffk@apple.com>
* gcc.dg/rs6000-ldouble-2.c: New.

View file

@ -0,0 +1,11 @@
! { dg-do run }
! pr18398, missing data on sequential formatted reads
! test contributed by Thomas.Koenig@online.de
open(7,status='scratch')
write (7,'(F12.5)') 1.0, 2.0, 3.0
rewind(7)
read(7,'(F15.5)') a,b
! note the read format is wider than the write
if (abs(a-1.0) .gt. 1e-5) call abort
if (abs(b-2.0) .gt. 1e-5) call abort
end

View file

@ -1,3 +1,9 @@
2005-01-07 Bud Davis <bdavis9659@comcast.net>
PR fortran/18398
* transfer.c (next_record_r): always skip the
eol search if it was found during sf_read.
2004-12-27 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
* libgfortran/libgfortran.h (GFC_UINTEGER_1, GFC_UINTEGER_2):

View file

@ -1209,7 +1209,8 @@ next_record_r (int done)
case FORMATTED_SEQUENTIAL:
length = 1;
if (sf_seen_eor && done)
/* sf_read has already terminated input because of an '\n' */
if (sf_seen_eor)
break;
do