[gfortran] Fix list directed reads of real number

Steven Bosscher stevenb@suse.de
Fri Dec 10 22:12:00 GMT 2004


On Friday 10 December 2004 22:52, Steve Kargl wrote:
> On Fri, Dec 10, 2004 at 11:27:27AM -0800, Steve Kargl wrote:
> Crud!  The patch doesn't totally fix the problem.
>
> troutmask:sgk[330] gfc -o fg fg.f90
> troutmask:sgk[331] ./fg
>  10,-20,30,40
>    10.00000       0.000000       30.00000       40.00000
> troutmask:sgk[332] cat fg.f90
> program fg
>   character(len=80) buff
>   write (buff,'(a)') '10,-20,30,40'
>   read(buff,*) a, b, c, d
>   print *, buff
>   print*, a, b, c, d
> end program
>
> If a minus sign follows a comma, my  patch appears to miss
> the next digit.

What happens is that when the library is asked to read the second real,
it is still looking at the comma.  I would expect it to gobble that as
part of reading the first real.

Gr.
Steven



More information about the Fortran mailing list