re PR fortran/31051 ([4.2 Only] gfortran bug with x and t format descriptors.)

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.

From-SVN: r122940
This commit is contained in:
Jerry DeLisle 2007-03-15 01:25:27 +00:00
parent 15ce86a7e5
commit 22cbc70726
2 changed files with 14 additions and 3 deletions

View File

@ -1,3 +1,9 @@
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.
2007-03-14 Thomas Koenig <Thomas.Koenig@online.de> 2007-03-14 Thomas Koenig <Thomas.Koenig@online.de>
PR libfortran/30690 PR libfortran/30690

View File

@ -1155,7 +1155,7 @@ formatted_transfer_scalar (st_parameter_dt *dtp, bt type, void *p, int len,
/* Format codes that don't transfer data. */ /* Format codes that don't transfer data. */
case FMT_X: case FMT_X:
case FMT_TR: case FMT_TR:
consume_data_flag = 0 ; consume_data_flag = 0;
pos = bytes_used + f->u.n + dtp->u.p.skips; pos = bytes_used + f->u.n + dtp->u.p.skips;
dtp->u.p.skips = 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); write_x (dtp, dtp->u.p.skips, dtp->u.p.pending_spaces);
dtp->u.p.skips = dtp->u.p.pending_spaces = 0; dtp->u.p.skips = dtp->u.p.pending_spaces = 0;
} }
if (dtp->u.p.mode == READING) if (dtp->u.p.mode == READING)
read_x (dtp, f->u.n); 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_TL:
case FMT_T: case FMT_T:
consume_data_flag = 0;
if (f->format == FMT_TL) 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 */ else /* FMT_T */
{ {
consume_data_flag = 0; if (dtp->u.p.mode == READING)
pos = f->u.n - 1; 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 /* Standard 10.6.1.1: excessive left tabbing is reset to the