summaryrefslogtreecommitdiff
path: root/libgfortran/io/open.c
diff options
context:
space:
mode:
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 d95eccbc12d..84575f7bb01 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;