summaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorJerry DeLisle <jvdelisle@gcc.gnu.org>2008-06-28 21:46:53 +0000
committerJerry DeLisle <jvdelisle@gcc.gnu.org>2008-06-28 21:46:53 +0000
commit7b063fdc13690972046aa3e7920402fbb5b6f7a7 (patch)
treeed72ba127563a9eca37fe1c7840c876221e5117a /libgfortran
parentd1c1c79f19f5026581abea4c4d27850ce7568948 (diff)
downloadgcc-7b063fdc13690972046aa3e7920402fbb5b6f7a7.tar.gz
re PR libfortran/36657 (Namelist reading bug with string constant immediately followed by comment)
2008-06-28 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/36657 * io/list_read.c (read_character): Check for '!' along with separators. (find_nml_name): Likewise and eat the comment if found. From-SVN: r137236
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/ChangeLog6
-rw-r--r--libgfortran/io/list_read.c7
2 files changed, 10 insertions, 3 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index ac9e2710a28..69a205949bf 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,9 @@
+2008-06-28 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR fortran/36657
+ * io/list_read.c (read_character): Check for '!' along with separators.
+ (find_nml_name): Likewise and eat the comment if found.
+
2008-06-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* configure: Regenerate.
diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c
index ffa23693a86..82c288f6c6e 100644
--- a/libgfortran/io/list_read.c
+++ b/libgfortran/io/list_read.c
@@ -1083,7 +1083,7 @@ read_character (st_parameter_dt *dtp, int length __attribute__ ((unused)))
invalid. */
done:
c = next_char (dtp);
- if (is_separator (c))
+ if (is_separator (c) || c == '!')
{
unget_char (dtp, c);
eat_separator (dtp);
@@ -2916,13 +2916,14 @@ find_nml_name:
/* A trailing space is required, we give a little lattitude here, 10.9.1. */
c = next_char (dtp);
- if (!is_separator(c))
+ if (!is_separator(c) && c != '!')
{
unget_char (dtp, c);
goto find_nml_name;
}
- eat_separator (dtp);
+ if (c == '!')
+ eat_line (dtp);
/* Ready to read namelist objects. If there is an error in input
from stdin, output the error message and continue. */