[patch, libfortran] PR33253 namelist: reading back a string with apostrophe

Jerry DeLisle jvdelisle@verizon.net
Mon Sep 3 19:01:00 GMT 2007

:ADDPATCH fortran:

Hi all,

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.

This patch fixes this by not doing this bail out unless a specific delimiter was 
specified in the OPEN statement, otherwise, read_character proceeds to read the 
string until it finds a valid separator.

Minor tweaks to namelist_15.f90 and namelist_24.f90 are required. New test case 

Regression tested on x86-64-gnu-linux.

OK for trunk?



2007-09-03  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/33253
	* io/list_read.c (read_character): Use DELIM_APOSTROPHE and DELIM_QUOTE
	in check of first character in string.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr33253.diff
Type: text/x-patch
Size: 1665 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070903/5cd60516/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: namelist_38.f90
Type: text/x-fortran
Size: 415 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070903/5cd60516/attachment-0001.bin>

More information about the Gcc-patches mailing list