From 22cbc70726b96dbdc4b5fee428af20843423190a Mon Sep 17 00:00:00 2001 From: Jerry DeLisle Date: Thu, 15 Mar 2007 01:25:27 +0000 Subject: [PATCH] re PR fortran/31051 ([4.2 Only] gfortran bug with x and t format descriptors.) 2007-03-14 Jerry DeLisle PR libgfortran/31051 * io/transfer.c (formatted_transfer_scalar): Adjust position for pending spaces when in writing mode. Clean up some formatting. From-SVN: r122940 --- libgfortran/ChangeLog | 6 ++++++ libgfortran/io/transfer.c | 11 ++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 1b3cff570c3..d793b727b26 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,9 @@ +2007-03-14 Jerry DeLisle + + PR libgfortran/31051 + * io/transfer.c (formatted_transfer_scalar): Adjust position for pending + spaces when in writing mode. Clean up some formatting. + 2007-03-14 Thomas Koenig PR libfortran/30690 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