+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
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;
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
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;
}
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);
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);
push_char (dtp, 'n');
}
- dtp->u.p.item_count = 0;
- dtp->u.p.line_buffer_enabled = 0;
free_line (dtp);
goto done;