diff options
Diffstat (limited to 'libgfortran/io/read.c')
-rw-r--r-- | libgfortran/io/read.c | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/libgfortran/io/read.c b/libgfortran/io/read.c index e35a7b1..5fb1e3c 100644 --- a/libgfortran/io/read.c +++ b/libgfortran/io/read.c @@ -440,9 +440,8 @@ read_a (st_parameter_dt *dtp, const fnode *f, char *p, int length) else read_default_char1 (dtp, p, length, w); - dtp->u.p.sf_read_comma = 1; - if (dtp->common.flags & IOPARM_DT_HAS_F2003) - dtp->u.p.sf_read_comma = dtp->u.p.decimal_status == DECIMAL_COMMA ? 0 : 1; + dtp->u.p.sf_read_comma = + dtp->u.p.current_unit->decimal_status == DECIMAL_COMMA ? 0 : 1; } @@ -468,9 +467,8 @@ read_a_char4 (st_parameter_dt *dtp, const fnode *f, char *p, int length) else read_default_char4 (dtp, p, length, w); - dtp->u.p.sf_read_comma = 1; - if (dtp->common.flags & IOPARM_DT_HAS_F2003) - dtp->u.p.sf_read_comma = dtp->u.p.decimal_status == DECIMAL_COMMA ? 0 : 1; + dtp->u.p.sf_read_comma = + dtp->u.p.current_unit->decimal_status == DECIMAL_COMMA ? 0 : 1; } /* eat_leading_spaces()-- Given a character pointer and a width, @@ -842,9 +840,9 @@ read_f (st_parameter_dt *dtp, const fnode *f, char *dest, int length) switch (*p) { case ',': - if ((dtp->common.flags & IOPARM_DT_HAS_F2003) - && (dtp->u.p.decimal_status == DECIMAL_COMMA && *p == ',')) - *p = '.'; + if (dtp->u.p.current_unit->decimal_status == DECIMAL_COMMA + && *p == ',') + *p = '.'; else goto bad_float; /* Fall through */ @@ -1079,17 +1077,9 @@ read_f (st_parameter_dt *dtp, const fnode *f, char *dest, int length) void read_x (st_parameter_dt * dtp, int n) { - if (dtp->common.flags & IOPARM_DT_HAS_F2003) - { - if ((dtp->u.p.pad_status == PAD_NO || is_internal_unit (dtp)) - && dtp->u.p.current_unit->bytes_left < n) - n = dtp->u.p.current_unit->bytes_left; - } - else - { - if (is_internal_unit (dtp) && dtp->u.p.current_unit->bytes_left < n) - n = dtp->u.p.current_unit->bytes_left; - } + if ((dtp->u.p.current_unit->pad_status == PAD_NO || is_internal_unit (dtp)) + && dtp->u.p.current_unit->bytes_left < n) + n = dtp->u.p.current_unit->bytes_left; dtp->u.p.sf_read_comma = 0; if (n > 0) |