]> gcc.gnu.org Git - gcc.git/commitdiff
re PR libfortran/25631 (tl format specifier not working correctly)
authorJerry DeLisle <jvdelisle@gcc.gnu.org>
Wed, 18 Jan 2006 00:52:21 +0000 (00:52 +0000)
committerJerry DeLisle <jvdelisle@gcc.gnu.org>
Wed, 18 Jan 2006 00:52:21 +0000 (00:52 +0000)
2006-01-17  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

PR libgfortran/25631
* io/transfer.c (formatted_transfer_scalar): Adjust pending_spaces and
skips so that TL works correctly when no bytes_used yet.

From-SVN: r109858

libgfortran/ChangeLog
libgfortran/io/transfer.c

index 5ce87028e72338300e4b35949c1f5199c60486a3..d5e178ed9f310e947150b40b50a0372cb3219f70 100644 (file)
@@ -1,3 +1,9 @@
+2006-01-17  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libgfortran/25631
+       * io/transfer.c (formatted_transfer_scalar): Adjust pending_spaces and
+       skips so that TL works correctly when no bytes_used yet.  
+
 2006-01-16  Roger Sayle  <roger@eyesopen.com>
 
        * configure.ac (CFLAGS): Update to include -std=gnu99 so that
index 049ebb24771981fcd14e1f30c28da60c8e0b89e5..729883586f87d7350ca84ca55170eb290f328f46 100644 (file)
@@ -868,7 +868,21 @@ formatted_transfer_scalar (st_parameter_dt *dtp, bt type, void *p, int len,
        case FMT_TL:
        case FMT_T:
          if (f->format == FMT_TL)
-           pos = bytes_used - f->u.n;
+           {
+
+             /* Handle the special case when no bytes have been used yet.
+                Cannot go below zero. */
+             if (bytes_used == 0)
+               {
+                 dtp->u.p.pending_spaces -= f->u.n;
+                 dtp->u.p.pending_spaces = dtp->u.p.pending_spaces < 0 ? 0
+                                           : dtp->u.p.pending_spaces;
+                 dtp->u.p.skips -= f->u.n;
+                 dtp->u.p.skips = dtp->u.p.skips < 0 ? 0 : dtp->u.p.skips;
+               }
+
+             pos = bytes_used - f->u.n;
+           }
          else /* FMT_T */
            {
              consume_data_flag = 0;
This page took 0.068883 seconds and 5 git commands to generate.