mirror of git://gcc.gnu.org/git/gcc.git
re PR libfortran/37707 (Namelist read of array of derived type incorrect)
2008-10-22 Jerry DeLisle <jvdelisle@gcc.gnu.org PR libfortran/37707 * io/list_read.c (read_character): Remove code to look ahead in namelist reads to descriminate non-delimited strings from namelist objects. * io/write.c (namelist_write): Delimit character strings with quote or apostrophe, defaulting to quote. From-SVN: r141317
This commit is contained in:
parent
a7bd6332ac
commit
a7f5d0542a
|
@ -1,3 +1,11 @@
|
||||||
|
2008-10-22 Jerry DeLisle <jvdelisle@gcc.gnu.org
|
||||||
|
|
||||||
|
PR libfortran/37707
|
||||||
|
* io/list_read.c (read_character): Remove code to look ahead in namelist
|
||||||
|
reads to descriminate non-delimited strings from namelist objects.
|
||||||
|
* io/write.c (namelist_write): Delimit character strings with quote or
|
||||||
|
apostrophe, defaulting to quote.
|
||||||
|
|
||||||
2008-10-21 Thomas Koenig <tkoenig@gcc.gnu.org>
|
2008-10-21 Thomas Koenig <tkoenig@gcc.gnu.org>
|
||||||
|
|
||||||
PR libfortran/34670
|
PR libfortran/34670
|
||||||
|
|
|
@ -929,52 +929,8 @@ read_character (st_parameter_dt *dtp, int length __attribute__ ((unused)))
|
||||||
default:
|
default:
|
||||||
if (dtp->u.p.namelist_mode)
|
if (dtp->u.p.namelist_mode)
|
||||||
{
|
{
|
||||||
if (dtp->u.p.current_unit->delim_status == DELIM_APOSTROPHE
|
unget_char (dtp, c);
|
||||||
|| dtp->u.p.current_unit->delim_status == DELIM_QUOTE
|
return;
|
||||||
|| c == '&' || c == '$' || c == '/')
|
|
||||||
{
|
|
||||||
unget_char (dtp, c);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Check to see if we are seeing a namelist object name by using the
|
|
||||||
line buffer and looking ahead for an '=' or '('. */
|
|
||||||
l_push_char (dtp, c);
|
|
||||||
|
|
||||||
int i;
|
|
||||||
for(i = 0; i < 63; i++)
|
|
||||||
{
|
|
||||||
c = next_char (dtp);
|
|
||||||
if (is_separator(c))
|
|
||||||
{
|
|
||||||
unget_char (dtp, c);
|
|
||||||
eat_separator (dtp);
|
|
||||||
c = next_char (dtp);
|
|
||||||
if (c != '=')
|
|
||||||
{
|
|
||||||
l_push_char (dtp, c);
|
|
||||||
dtp->u.p.item_count = 0;
|
|
||||||
dtp->u.p.line_buffer_enabled = 1;
|
|
||||||
goto get_string;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
l_push_char (dtp, c);
|
|
||||||
|
|
||||||
if (c == '=' || c == '(')
|
|
||||||
{
|
|
||||||
dtp->u.p.item_count = 0;
|
|
||||||
dtp->u.p.nml_read_error = 1;
|
|
||||||
dtp->u.p.line_buffer_enabled = 1;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* The string is too long to be a valid object name so assume that it
|
|
||||||
is a string to be read in as a value. */
|
|
||||||
dtp->u.p.item_count = 0;
|
|
||||||
dtp->u.p.line_buffer_enabled = 1;
|
|
||||||
goto get_string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
push_char (dtp, c);
|
push_char (dtp, c);
|
||||||
|
|
|
@ -1442,20 +1442,8 @@ namelist_write (st_parameter_dt *dtp)
|
||||||
|
|
||||||
/* Set the delimiter for namelist output. */
|
/* Set the delimiter for namelist output. */
|
||||||
tmp_delim = dtp->u.p.current_unit->delim_status;
|
tmp_delim = dtp->u.p.current_unit->delim_status;
|
||||||
switch (tmp_delim)
|
|
||||||
{
|
|
||||||
case (DELIM_QUOTE):
|
|
||||||
dtp->u.p.nml_delim = '"';
|
|
||||||
break;
|
|
||||||
|
|
||||||
case (DELIM_APOSTROPHE):
|
dtp->u.p.nml_delim = tmp_delim == DELIM_APOSTROPHE ? '\'' : '"';
|
||||||
dtp->u.p.nml_delim = '\'';
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
dtp->u.p.nml_delim = '\0';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Temporarily disable namelist delimters. */
|
/* Temporarily disable namelist delimters. */
|
||||||
dtp->u.p.current_unit->delim_status = DELIM_NONE;
|
dtp->u.p.current_unit->delim_status = DELIM_NONE;
|
||||||
|
|
Loading…
Reference in New Issue