This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[gfortran] patch PR 19216


The attached two-lines patch fixes PR libfortran/19216 (incorrectly handling slash in list-directed input). Testcase and ChangeLog attached.

*strapped and regtested on mainline branch (i386-linux), testing in progress on 4.0. OK?

"Yet Another Trivial Patch"
FX
! PR libfortran/19216
! {dg-do run}
       integer dat(3), i, j
       data dat / 3,2,1 /

       open (20, status='scratch')
       write (20,'(A)') '/ 10 20 30'
       write (20,'(A)') '1 2 3 4'
       write (20,'(A)') '5 6 7 8'
       rewind (20)
       read (20,*) (dat(i), i=1,3)
       if (dat(1).ne.3 .or. dat(2).ne.2 .or. dat(3).ne.1) call abort
       read (20,*) I,J
       if (i .ne. 1 .or. j .ne. 2) call abort
       read (20,*) I,J
       if (i .ne. 5 .or. j .ne. 6) call abort
       close(20)
       end
2005-03-31  Francois-Xavier Coudert  <coudert@clipper.ens.fr>

	PR libfortran/19216
	* io/list_read.c (eat_separator): Slash separator needs
	calling next_record only in finish_separator.


2005-03-31  Francois-Xavier Coudert  <coudert@clipper.ens.fr>

	PR libfortran/19216
	* gfortran.dg/pr19216.f: New test.

Index: libgfortran/io/list_read.c
===================================================================
RCS file: /cvsroot/gcc/gcc/libgfortran/io/list_read.c,v
retrieving revision 1.15
diff -p -u -r1.15 list_read.c
--- libgfortran/io/list_read.c	25 Mar 2005 13:35:29 -0000	1.15
+++ libgfortran/io/list_read.c	31 Mar 2005 19:04:56 -0000
@@ -226,8 +226,6 @@ eat_separator (void)
 
     case '/':
       input_complete = 1;
-      next_record (0);
-      at_eol = 1;
       break;
 
     case '\n':

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]