summaryrefslogtreecommitdiff
path: root/libgfortran/io
diff options
context:
space:
mode:
authorjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>2015-11-23 00:40:51 +0000
committerjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>2015-11-23 00:40:51 +0000
commit14b5bae1fd51987b27a755138c7155f54591dbf2 (patch)
treee5e8c746f9bcb41da40d8a8a3636e8972be8c2aa /libgfortran/io
parente46a3ff0012318f047b5efee226268bdfd129c5e (diff)
downloadgcc-14b5bae1fd51987b27a755138c7155f54591dbf2.tar.gz
2015-11-22 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libfortran/52251 * io/transfer.c (formatted_transfer_scalar_write): Reset skips count. (finalize_transfer): For ADVANCE_NO, emit pending spaces and reset the skip count. 2015-11-22 Jerry DeLisle <jvdelisle@gcc.gnu.org> * gfortran.dg/fmt_t_8.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230734 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/io')
-rw-r--r--libgfortran/io/transfer.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c
index 746bb6dcc6c..94f1edaa679 100644
--- a/libgfortran/io/transfer.c
+++ b/libgfortran/io/transfer.c
@@ -1641,6 +1641,7 @@ formatted_transfer_scalar_write (st_parameter_dt *dtp, bt type, void *p, int kin
- dtp->u.p.current_unit->bytes_left);
dtp->u.p.max_pos =
dtp->u.p.max_pos > tmp ? dtp->u.p.max_pos : tmp;
+ dtp->u.p.skips = 0;
}
if (dtp->u.p.skips < 0)
{
@@ -3600,6 +3601,16 @@ finalize_transfer (st_parameter_dt *dtp)
next I/O operation if needed. */
if (dtp->u.p.advance_status == ADVANCE_NO)
{
+ if (dtp->u.p.skips > 0)
+ {
+ int tmp;
+ write_x (dtp, dtp->u.p.skips, dtp->u.p.pending_spaces);
+ tmp = (int)(dtp->u.p.current_unit->recl
+ - dtp->u.p.current_unit->bytes_left);
+ dtp->u.p.max_pos =
+ dtp->u.p.max_pos > tmp ? dtp->u.p.max_pos : tmp;
+ dtp->u.p.skips = 0;
+ }
int bytes_written = (int) (dtp->u.p.current_unit->recl
- dtp->u.p.current_unit->bytes_left);
dtp->u.p.current_unit->saved_pos =