http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60148

--- Comment #5 from kargl at gcc dot gnu.org ---
(In reply to Jerry DeLisle from comment #4)
> Like this:
> 
> &MYLIST
>  MYSTRING        = 'tue  '
>  /
>  &MYLIST
>  MYSTRING        = "tue  "
>  /
>  &MYLIST
>  MYSTRING        = tue  
>  /
>  &MYLIST
>  MYSTRING        = tue  
>  /

Dang!  You beat me to the patch.  Here's what I have.
I'm not sure if the first chunk is needed.  Currently,
running the testsuite.

Index: io/write.c
===================================================================
--- io/write.c  (revision 207664)
+++ io/write.c  (working copy)
@@ -1832,8 +1832,10 @@ nml_write_obj (st_parameter_dt *dtp, nam
                dtp->u.p.current_unit->delim_status = DELIM_QUOTE;
              if (dtp->u.p.nml_delim == '\'')
                dtp->u.p.current_unit->delim_status = DELIM_APOSTROPHE;
+             if (dtp->u.p.nml_delim == ' ')
+               dtp->u.p.current_unit->delim_status = DELIM_NONE;
              write_character (dtp, p, 1, obj->string_length);
-               dtp->u.p.current_unit->delim_status = tmp_delim;
+             dtp->u.p.current_unit->delim_status = tmp_delim;
               break;

            case BT_REAL:
@@ -1972,7 +1974,12 @@ namelist_write (st_parameter_dt *dtp)
   /* Set the delimiter for namelist output.  */
   tmp_delim = dtp->u.p.current_unit->delim_status;

-  dtp->u.p.nml_delim = tmp_delim == DELIM_APOSTROPHE ? '\'' : '"';
+  if (tmp_delim == DELIM_APOSTROPHE)
+    dtp->u.p.nml_delim = '\'';
+  else if (tmp_delim == DELIM_QUOTE)
+    dtp->u.p.nml_delim = '"';
+  else
+    dtp->u.p.nml_delim = ' ';

   /* Temporarily disable namelist delimters.  */
   dtp->u.p.current_unit->delim_status = DELIM_NONE;

Reply via email to