Patch proposal for PR 19679

François-Xavier Coudert Francois-Xavier.Coudert@lcp.u-psud.fr
Thu Feb 24 16:23:00 GMT 2005


> Here comes a patch for PR 19679 (DOS files don't work for formatted 
> input if line length is exceeded). This is not in good form,

Sorry this mail got sent before I actually finished writing it. This time, I 
tried to get the patch in good form (as well as the ChangeLog entry).

*strapped and regtested on i686-linux.




2005-02-24  François-Xavier Coudert  <coudert@clipper.ens.fr>

     PR libfortran/19679
     * list_read.c (read_sf): Add a '\r' in a test to support DOS 
line-endings when line length is exceeded.

Index: gcc/gcc/libgfortran/io/transfer.c
===================================================================
RCS file: /cvsroot/gcc/gcc/libgfortran/io/transfer.c,v
retrieving revision 1.31
diff -u -p -r1.31 transfer.c
--- io/transfer.c       29 Jan 2005 15:45:17 -0000      1.31
+++ io/transfer.c       24 Feb 2005 16:08:43 -0000
@@ -177,7 +177,7 @@ read_sf (int *length)
           return NULL;
         }

-      if (readlen < 1 || *q == '\n')
+      if (readlen < 1 || *q == '\n' || *q == '\r')
         {
           /* ??? What is this for?  */
            if (current_unit->unit_number == options.stdin_unit)



More information about the Fortran mailing list