2008-02-20 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+ PR libfortran/35132
+ * io/transfer.c (next_record_w): Truncate after the last record for
+ STREAM I/O.
+
+ PR libfortran/34954
+ * io/transfer.c (data_transfer_init): Initialize dtp->rec if writing.
+
+ PR libfortran/34974
+ * io/transfer.c (formatted_transfer_scalar): Flush the buffer if skips
+ is less than zero. (next_record_w): Use sseek to position the file to
+ the max position reached.
+
+2008-02-20 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
PR libfortran/35036
* write_float.def (output_float): Add error checks for zero digits
after decimal point in E and D format specifiers.
the entire field has been read. The next read field will start right after
the comma in the stream. (Set to 0 for character reads). */
dtp->u.p.sf_read_comma = 1;
-
dtp->u.p.line_buffer = scratch;
+
for (;;)
{
/* If reversion has occurred and there is another real data item,
else
read_x (dtp, dtp->u.p.skips);
}
+ else
+ {
+ if (dtp->u.p.skips < 0)
+ flush (dtp->u.p.current_unit->s);
+ }
break;
dtp->u.p.current_unit->strm_pos = dtp->rec;
}
+ else
+ dtp->rec = 0;
/* Overwriting an existing sequential file ?
it is always safe to truncate the file on the first write */
if (max_pos > m)
{
length = (int) (max_pos - m);
- p = salloc_w (dtp->u.p.current_unit->s, &length);
+ sseek (dtp->u.p.current_unit->s,
+ file_position (dtp->u.p.current_unit->s) + length);
}
#ifdef HAVE_CRLF
len = 2;
goto io_error;
if (is_stream_io (dtp))
- dtp->u.p.current_unit->strm_pos += len;
+ {
+ dtp->u.p.current_unit->strm_pos += len;
+ struncate(dtp->u.p.current_unit->s);
+ }
}
break;