diff options
author | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2008-03-20 02:05:05 +0000 |
---|---|---|
committer | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2008-03-20 02:05:05 +0000 |
commit | 17f46ec355995413b4eefb3e37863c558619c113 (patch) | |
tree | 84808a336f7a3932720ebda87346a26c3b1cfe51 /libgfortran | |
parent | 31e6722c276d4bfc6d40c138ca2576716ef93ec8 (diff) | |
download | gcc-17f46ec355995413b4eefb3e37863c558619c113.zip gcc-17f46ec355995413b4eefb3e37863c558619c113.tar.gz gcc-17f46ec355995413b4eefb3e37863c558619c113.tar.bz2 |
re PR fortran/35627 (namelist read error)
2008-03-19 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libfortran/35627
* io/list_read.c (free_line): Clear the line buffer enable flag and
reset the index into line_buffer, aka item_count.
(next_char): Cleanup whitespace.
(read_logical): Use unget_char to assure that the first character of the
bad logical is saved in case it is part of an object name. Remove the
clearing of index and flag that is now in free_line.
(read_real): Likewise.
From-SVN: r133360
Diffstat (limited to 'libgfortran')
-rw-r--r-- | libgfortran/ChangeLog | 11 | ||||
-rw-r--r-- | libgfortran/io/list_read.c | 16 |
2 files changed, 19 insertions, 8 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 6a1865e..ee0aae8 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,14 @@ +2008-03-19 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR libfortran/35627 + * io/list_read.c (free_line): Clear the line buffer enable flag and + reset the index into line_buffer, aka item_count. + (next_char): Cleanup whitespace. + (read_logical): Use unget_char to assure that the first character of the + bad logical is saved in case it is part of an object name. Remove the + clearing of index and flag that is now in free_line. + (read_real): Likewise. + 2008-03-19 Thomas Koenig <tkoenig@gcc.gnu.org> PR libfortran/32972 diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c index cbe4a649..d295431 100644 --- a/libgfortran/io/list_read.c +++ b/libgfortran/io/list_read.c @@ -120,6 +120,9 @@ free_saved (st_parameter_dt *dtp) static void free_line (st_parameter_dt *dtp) { + dtp->u.p.item_count = 0; + dtp->u.p.line_buffer_enabled = 0; + if (dtp->u.p.line_buffer == NULL) return; @@ -157,8 +160,8 @@ next_char (st_parameter_dt *dtp) goto done; } - dtp->u.p.item_count = 0; - dtp->u.p.line_buffer_enabled = 0; + dtp->u.p.item_count = 0; + dtp->u.p.line_buffer_enabled = 0; } /* Handle the end-of-record and end-of-file conditions for @@ -685,6 +688,9 @@ read_logical (st_parameter_dt *dtp, int length) return; /* Null value. */ default: + /* Save the character in case it is the beginning + of the next object name. */ + unget_char (dtp, c); goto bad_logical; } @@ -700,8 +706,6 @@ read_logical (st_parameter_dt *dtp, int length) unget_char (dtp, c); eat_separator (dtp); - dtp->u.p.item_count = 0; - dtp->u.p.line_buffer_enabled = 0; set_integer ((int *) dtp->u.p.value, v, length); free_line (dtp); @@ -755,8 +759,6 @@ read_logical (st_parameter_dt *dtp, int length) logical_done: - dtp->u.p.item_count = 0; - dtp->u.p.line_buffer_enabled = 0; dtp->u.p.saved_type = BT_LOGICAL; dtp->u.p.saved_length = length; set_integer ((int *) dtp->u.p.value, v, length); @@ -1640,8 +1642,6 @@ read_real (st_parameter_dt *dtp, int length) push_char (dtp, 'n'); } - dtp->u.p.item_count = 0; - dtp->u.p.line_buffer_enabled = 0; free_line (dtp); goto done; |