This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/32678] GFortan works incorrectly when writing with FORMAT Tx
- From: "jvdelisle at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Jul 2007 22:37:17 -0000
- Subject: [Bug fortran/32678] GFortan works incorrectly when writing with FORMAT Tx
- References: <bug-32678-12095@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from jvdelisle at gcc dot gnu dot org 2007-07-08 22:37 -------
This appears to fix it: Still testing
Index: transfer.c
===================================================================
--- transfer.c (revision 126449)
+++ transfer.c (working copy)
@@ -1213,6 +1213,8 @@ formatted_transfer_scalar (st_parameter_
dtp->u.p.skips = dtp->u.p.skips + pos - bytes_used;
dtp->u.p.pending_spaces = dtp->u.p.pending_spaces
+ pos - dtp->u.p.max_pos;
+ dtp->u.p.pending_spaces = dtp->u.p.pending_spaces < 0
+ ? 0 : dtp->u.p.pending_spaces;
if (dtp->u.p.skips == 0)
break;
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32678