diff options
author | jvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-03-15 01:25:27 +0000 |
---|---|---|
committer | jvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-03-15 01:25:27 +0000 |
commit | dbdf5af5ddf971658de197f1a3d8a03009004917 (patch) | |
tree | 9bbc9ec536b7e5d79d91dac13e2a816137da8271 /libgfortran/io | |
parent | e97029bc8a675c2ed019cb86164f5ac63e43768f (diff) | |
download | gcc-dbdf5af5ddf971658de197f1a3d8a03009004917.tar.gz |
2007-03-14 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/31051
* io/transfer.c (formatted_transfer_scalar): Adjust position for pending
spaces when in writing mode. Clean up some formatting.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@122940 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/io')
-rw-r--r-- | libgfortran/io/transfer.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c index 42f82493942..2c1558e6b06 100644 --- a/libgfortran/io/transfer.c +++ b/libgfortran/io/transfer.c @@ -1155,7 +1155,7 @@ formatted_transfer_scalar (st_parameter_dt *dtp, bt type, void *p, int len, /* Format codes that don't transfer data. */ case FMT_X: case FMT_TR: - consume_data_flag = 0 ; + consume_data_flag = 0; pos = bytes_used + f->u.n + dtp->u.p.skips; dtp->u.p.skips = f->u.n + dtp->u.p.skips; @@ -1171,6 +1171,7 @@ formatted_transfer_scalar (st_parameter_dt *dtp, bt type, void *p, int len, write_x (dtp, dtp->u.p.skips, dtp->u.p.pending_spaces); dtp->u.p.skips = dtp->u.p.pending_spaces = 0; } + if (dtp->u.p.mode == READING) read_x (dtp, f->u.n); @@ -1178,6 +1179,8 @@ formatted_transfer_scalar (st_parameter_dt *dtp, bt type, void *p, int len, case FMT_TL: case FMT_T: + consume_data_flag = 0; + if (f->format == FMT_TL) { @@ -1196,8 +1199,10 @@ formatted_transfer_scalar (st_parameter_dt *dtp, bt type, void *p, int len, } else /* FMT_T */ { - consume_data_flag = 0; - pos = f->u.n - 1; + if (dtp->u.p.mode == READING) + pos = f->u.n - 1; + else + pos = f->u.n - dtp->u.p.pending_spaces - 1; } /* Standard 10.6.1.1: excessive left tabbing is reset to the |