aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/io/open.c
diff options
context:
space:
mode:
authorJanne Blomqvist <jb@gcc.gnu.org>2008-05-16 20:42:44 +0300
committerJanne Blomqvist <jb@gcc.gnu.org>2008-05-16 20:42:44 +0300
commit8947fd62fa9414017f0fe4f3075112e2a9ce9e44 (patch)
treeb8d80d6121e1e056d1aaacd9882dd2ff45f168cb /libgfortran/io/open.c
parent65686652e48ae64f331078abe64b344e3318cfb8 (diff)
downloadgcc-8947fd62fa9414017f0fe4f3075112e2a9ce9e44.zip
gcc-8947fd62fa9414017f0fe4f3075112e2a9ce9e44.tar.gz
gcc-8947fd62fa9414017f0fe4f3075112e2a9ce9e44.tar.bz2
Part 1.1 of PR25561.
2008-05-15 Janne Blomqvist <jb@gcc.gnu.org> PR libfortran/25561 * io/io.h (struct fbuf): Change pointer to position offset. * io/fbuf.c (fbuf_init): Reduce default size of buffer, ptr=>pos changes. (fbuf_reset): ptr=>pos changes. (fbuf_alloc): If the request doesn't fit, don't waste memory by keeping flushed bytes. ptr=>pos changes. (fbuf_flush): ptr=>pos changes. (fbuf_seek): Don't seek past the left tab limit, don't update active byte count. * io/open.c (new_unit): If RECL has been specified, used that as initial buffer size. From-SVN: r135433
Diffstat (limited to 'libgfortran/io/open.c')
-rw-r--r--libgfortran/io/open.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libgfortran/io/open.c b/libgfortran/io/open.c
index d95eccb..84575f7 100644
--- a/libgfortran/io/open.c
+++ b/libgfortran/io/open.c
@@ -628,9 +628,15 @@ new_unit (st_parameter_open *opp, gfc_unit *u, unit_flags * flags)
free_mem (opp->file);
if (flags->form == FORM_FORMATTED && (flags->action != ACTION_READ))
- fbuf_init (u, 0);
+ {
+ if ((opp->common.flags & IOPARM_OPEN_HAS_RECL_IN))
+ fbuf_init (u, u->recl);
+ else
+ fbuf_init (u, 0);
+ }
else
u->fbuf = NULL;
+
return u;