re PR fortran/65541 (namelist regression)

2015-03-25 Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/65541
	* io/write.c (nml_write_obj): Convert '+' to '%' before emitting
	object names in namelists.

From-SVN: r221682
This commit is contained in:
Jerry DeLisle 2015-03-26 02:44:34 +00:00
parent d94a1e7fe9
commit 9c5b1bf795
2 changed files with 13 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2015-03-25 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/65541
* io/write.c (nml_write_obj): Convert '+' to '%' before emitting
object names in namelists.
2015-03-22 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/59513

View File

@ -1704,10 +1704,11 @@ nml_write_obj (st_parameter_dt *dtp, namelist_info * obj, index_type offset,
size_t clen;
index_type elem_ctr;
size_t obj_name_len;
void * p ;
void * p;
char cup;
char * obj_name;
char * ext_name;
char * q;
size_t ext_name_len;
char rep_buff[NML_DIGITS];
namelist_info * cmp;
@ -1745,6 +1746,8 @@ nml_write_obj (st_parameter_dt *dtp, namelist_info * obj, index_type offset,
for (dim_i = len; dim_i < clen; dim_i++)
{
cup = toupper ((int) obj->var_name[dim_i]);
if (cup == '+')
cup = '%';
write_character (dtp, &cup, 1, 1, NODELIM);
}
write_character (dtp, "=", 1, 1, NODELIM);
@ -1894,6 +1897,9 @@ nml_write_obj (st_parameter_dt *dtp, namelist_info * obj, index_type offset,
}
ext_name[tot_len] = '\0';
for (q = ext_name; *q; q++)
if (*q == '+')
*q = '%';
/* Now obj_name. */