diff options
Diffstat (limited to 'libgfortran/io/open.c')
-rw-r--r-- | libgfortran/io/open.c | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/libgfortran/io/open.c b/libgfortran/io/open.c index 9b4f0cd..06fba75 100644 --- a/libgfortran/io/open.c +++ b/libgfortran/io/open.c @@ -413,23 +413,29 @@ new_unit (st_parameter_open *opp, gfc_unit *u, unit_flags * flags) else { u->flags.has_recl = 0; - switch (compile_options.record_marker) + u->recl = max_offset; + if (compile_options.max_subrecord_length) { - case 0: - u->recl = max_offset; - break; - - case sizeof (GFC_INTEGER_4): - u->recl = GFC_INTEGER_4_HUGE; - break; - - case sizeof (GFC_INTEGER_8): - u->recl = max_offset; - break; - - default: - runtime_error ("Illegal value for record marker"); - break; + u->recl_subrecord = compile_options.max_subrecord_length; + } + else + { + switch (compile_options.record_marker) + { + case 0: + /* Fall through */ + case sizeof (GFC_INTEGER_4): + u->recl_subrecord = GFC_MAX_SUBRECORD_LENGTH; + break; + + case sizeof (GFC_INTEGER_8): + u->recl_subrecord = max_offset - 16; + break; + + default: + runtime_error ("Illegal value for record marker"); + break; + } } } |