summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/namelist_73.f9028
-rw-r--r--libgfortran/ChangeLog5
-rw-r--r--libgfortran/io/list_read.c11
4 files changed, 39 insertions, 10 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 0b09a0cca24..fa059476905 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2011-08-18 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/50109
+ * gfortran.dg/namelist_73.f90: New.
+
2011-08-18 Jakub Jelinek <jakub@redhat.com>
* g++.dg/plugin/decl_plugin.c: Include diagnostic.h.
diff --git a/gcc/testsuite/gfortran.dg/namelist_73.f90 b/gcc/testsuite/gfortran.dg/namelist_73.f90
new file mode 100644
index 00000000000..8fc88aa1ed9
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/namelist_73.f90
@@ -0,0 +1,28 @@
+! { dg-do run }
+!
+! PR fortran/50109
+!
+! Contributed by Jim Hanson
+!
+ program namelist_test
+
+ integer nfp
+ namelist /indata/ nfp
+
+ nfp = 99
+ open(unit=4, status='scratch')
+ write(4,'(a)') '$indata'
+ write(4,'(a)') 'NFP = 5,'
+ write(4,'(a)') "! "
+ write(4,'(a)') "! "
+ write(4,'(a)') "! "
+ write(4,'(a)') '/'
+
+ rewind(4)
+ read (4,nml=indata)
+ close(4)
+
+! write(*,*) nfp
+ if (nfp /= 5) call abort()
+
+ end
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index a30f264307a..f846b08f9ae 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,8 @@
+2011-08-18 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/50109
+ * io/list_read.c (eat_separator): Fix skipping over "!" lines.
+
2011-07-23 Andreas Schwab <schwab@linux-m68k.org>
* intrinsics/ctime.c: Include <stdlib.h>.
diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c
index 01272d0cb4e..11a35c941cc 100644
--- a/libgfortran/io/list_read.c
+++ b/libgfortran/io/list_read.c
@@ -351,16 +351,7 @@ eat_separator (st_parameter_dt *dtp)
err = eat_line (dtp);
if (err)
return err;
- if ((c = next_char (dtp)) == EOF)
- return LIBERROR_END;
- if (c == '!')
- {
- err = eat_line (dtp);
- if (err)
- return err;
- if ((c = next_char (dtp)) == EOF)
- return LIBERROR_END;
- }
+ c = '\n';
}
}
while (c == '\n' || c == '\r' || c == ' ' || c == '\t');