diff options
author | jvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-03-26 02:44:34 +0000 |
---|---|---|
committer | jvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-03-26 02:44:34 +0000 |
commit | 6c87c4d94adab653b9a246f9386c5f2cc74efc05 (patch) | |
tree | bebd3a1da076710fc25d4ecd57793eb63a1ed42f /libgfortran/io/write.c | |
parent | 8b0fa8b98d77e4dae131218c8e89b3b08d094d67 (diff) | |
download | gcc-6c87c4d94adab653b9a246f9386c5f2cc74efc05.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@221682 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/io/write.c')
-rw-r--r-- | libgfortran/io/write.c | 8 |
1 files changed, 7 insertions, 1 deletions
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. */ |