re PR libfortran/17090 (Runtime I/O error)

2004-09-13  Bud Davis  <bdavis9659@comcast.net>

        PR fortran/17090

        * io/list_read.c (list_formatted_read): Handle trailing spaces
        at end of line.


2004-09-13  Bud Davis  <bdavis9659@comcast.net>

        PR fortran/17090
        * gfortran.dg/pr17090.f90: New test.

From-SVN: r87474
This commit is contained in:
Bud Davis 2004-09-14 00:56:46 +00:00 committed by Bud Davis
parent b6acab32f1
commit c72477d6a6
4 changed files with 39 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2004-09-13 Bud Davis <bdavis9659@comcast.net>
PR fortran/17090
* gfortran.dg/pr17090.f90: New test.
2004-09-13 Dale Johannesen <dalej@apple.com>
* gcc.c-torture/compile/pr17408.c: New test case.

View file

@ -0,0 +1,21 @@
! pr 17090 Runtime I/O error
! bdavis9659@comcast.net
! 9/12/2004
! list directed read with spaces between the last data item and the
! eoln cause missed data items.
! this is a libgfortran test case
implicit none
integer i,sum
real a(14)
data sum / 0 /
open(unit=9,status='SCRATCH')
write(9,*)1.0,2.0,3.0,4.0,' '
write(9,*)5.0,6.0,7.0,8.0,' '
write(9,*)9.0,10.0,11.0,12.0,13.0,14.0,' '
rewind(9)
read(9,*)a
do i = 1,14
sum = sum + a(i)
end do
if (sum.ne.105) call abort
end

View file

@ -1,3 +1,10 @@
2004-09-13 Bud Davis <bdavis9659@comcast.net>
PR fortran/17090
* io/list_read.c (list_formatted_read): Handle trailing spaces
at end of line.
2004-09-06 Steven G. Kargl <kargls@comcast.net>
* io/write.c (output_float): Typo in comment. Remove debugging

View file

@ -1270,7 +1270,12 @@ list_formatted_read (bt type, void *p, int len)
if (at_eol)
finish_separator ();
else
eat_spaces ();
{
eat_spaces ();
/* trailing spaces prior to end of line */
if (at_eol)
finish_separator ();
}
saved_type = BT_NULL;
repeat_count = 1;