From 9c5b1bf7953f9717943e40241be26cfc2422cd04 Mon Sep 17 00:00:00 2001 From: Jerry DeLisle Date: Thu, 26 Mar 2015 02:44:34 +0000 Subject: [PATCH] re PR fortran/65541 (namelist regression) 2015-03-25 Jerry DeLisle PR libgfortran/65541 * io/write.c (nml_write_obj): Convert '+' to '%' before emitting object names in namelists. From-SVN: r221682 --- libgfortran/ChangeLog | 6 ++++++ libgfortran/io/write.c | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index d66fc4b6bec..c96826a8774 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,9 @@ +2015-03-25 Jerry DeLisle + + PR libgfortran/65541 + * io/write.c (nml_write_obj): Convert '+' to '%' before emitting + object names in namelists. + 2015-03-22 Jerry DeLisle PR libgfortran/59513 diff --git a/libgfortran/io/write.c b/libgfortran/io/write.c index 3e890b981d1..75996598d0a 100644 --- a/libgfortran/io/write.c +++ b/libgfortran/io/write.c @@ -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. */ -- 2.30.2