:ADDPATCH fortran] Tobias Burnus wrote: > Hi Jerry, > > Jerry DeLisle wrote: >> The title of this PR is a bit misleading. The failure occurs with a >> string without the apostrophe as well. The problem here is that when >> reading a string, we look at the first character and see if it is a >> delimiter ' or " . If not we would skip out and not read the rest of >> the string. > > For me, it does not fully work yet. Using the following program: > -------------------- > program main > implicit none > character(len=3) :: a > namelist /foo/ a > open(10,delim="APOSTROPHE") > a = "a'a" > write(10,foo) > write (*,foo) > rewind 10 > read (10,foo) > end program main > -------------------- The attached patch fixes this buglet. We were not handling the interface to write_character quite right to convey the correct delimiting. Updated the test case to test the three possible delimiters that can be specified to assure the double quotes happen when they should. Interestingly, the write_character function had all the necessary workings to do this. :) Regression tested on x86-64-gnu-linux. OK for trunk? Regards, Jerry 2007-09-04 Jerry DeLisle PR libfortran/33253 * io/write.c (nml_write_obj): Set the delimiter correctly before calling write_character. (namelist_write): Clean up the code a little and add comments to clarify what its doing.