diff mbox

[libgfortran] PR56743 Namelist bug with comment and no blank

Message ID 55319C63.7030603@charter.net
State New
Headers show

Commit Message

Jerry DeLisle April 17, 2015, 11:50 p.m. UTC
The attached patch works by adding the comment character to the set of 
characters treated as separators.  This works because a namelist comment 
abstractly can be though of as equivalent to an end of line character.  For 
namelist the '!' character is already handled in the 'eat_separators' helper 
function, so the patch s really trivial.

The patch does not address character data that is not quote delimited. Besides 
the fact that using character data in namelists without quotes leaves a very bad 
taste in my mouth, I have not had time to look into it further in that area.

Regression tested on x86-64. I will dejanuize the test case attached.

OK for trunk?

Jerry

2015-04-17 Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/56743
	* io/list_read.c (CASE_SEPARATORS): Add case for '!'.
	(is_separator): Add condition for '!'.
diff mbox

Patch

Index: io/list_read.c
===================================================================
--- io/list_read.c	(revision 222194)
+++ io/list_read.c	(working copy)
@@ -53,12 +53,12 @@  typedef unsigned char uchar;
                       case '5': case '6': case '7': case '8': case '9'
 
 #define CASE_SEPARATORS  case ' ': case ',': case '/': case '\n': case '\t': \
-                         case '\r': case ';'
+                         case '\r': case ';': case '!'
 
 /* This macro assumes that we're operating on a variable.  */
 
 #define is_separator(c) (c == '/' ||  c == ',' || c == '\n' || c == ' ' \
-                         || c == '\t' || c == '\r' || c == ';')
+                         || c == '\t' || c == '\r' || c == ';' || c == '!')
 
 /* Maximum repeat count.  Less than ten times the maximum signed int32.  */