+<<<<<<< .mine
+2007-03-23 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libgfortran/31199
+ *io/io.h: Add saved_pos to gfc_unit structure.
+ *io/open.c (new_unit): Initialize saved_pos.
+ *io/transfer.c (data_transfer_init): Set max_pos to value in saved_pos.
+ (next_record_w): Fix whitespace.
+ (finalze_transfer): Calculate max_pos for ADVANCE="no" and save it for
+ later use. If not ADVANCE="no" set saved_pos to zero.
+
+=======
2007-03-25 Thomas Koenig <tkoenig@gcc.gnu.org>
PR libfortran/31196
* intrinsics/reshape_generic.c (reshape_internal): Increment
correct variable.
+>>>>>>> .r123204
2007-03-22 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/31052
struct gfc_unit *left, *right;
int priority;
- int read_bad, current_record;
+ int read_bad, current_record, saved_pos;
enum
{ NO_ENDFILE, AT_ENDFILE, AFTER_ENDFILE }
endfile;
dtp->u.p.blank_status = dtp->u.p.current_unit->flags.blank;
dtp->u.p.sign_status = SIGN_S;
+
+ /* Set the maximum position reached from the previous I/O operation. This
+ could be greater than zero from a previous non-advancing write. */
+ dtp->u.p.max_pos = dtp->u.p.current_unit->saved_pos;
pre_position (dtp);
}
else
{
-
/* If this is the last call to next_record move to the farthest
position reached in preparation for completing the record.
(for file unit) */
return;
}
+ /* For non-advancing I/O, save the current maximum position for use in the
+ next I/O operation if needed. */
if (dtp->u.p.advance_status == ADVANCE_NO)
{
+ int bytes_written = (int) (dtp->u.p.current_unit->recl
+ - dtp->u.p.current_unit->bytes_left);
+ dtp->u.p.current_unit->saved_pos =
+ dtp->u.p.max_pos > 0 ? dtp->u.p.max_pos - bytes_written : 0;
flush (dtp->u.p.current_unit->s);
return;
}
+ dtp->u.p.current_unit->saved_pos = 0;
+
next_record (dtp, 1);
sfree (dtp->u.p.current_unit->s);
}