summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbdavis <bdavis@138bc75d-0d04-0410-961f-82ee72b054a4>2004-09-14 00:56:46 +0000
committerbdavis <bdavis@138bc75d-0d04-0410-961f-82ee72b054a4>2004-09-14 00:56:46 +0000
commit224289f80bfd53801d14d738740945cab75ce578 (patch)
tree7ebe078cca9da25f699c5ad71ec58ff3464d3f8d
parentd27b0b64f68e4b90ca4a288dec295cad319e8caf (diff)
downloadgcc-224289f80bfd53801d14d738740945cab75ce578.tar.gz
2004-09-13 Bud Davis <bdavis9659@comcast.net>
PR fortran/17090 * io/list_read.c (list_formatted_read): Handle trailing spaces at end of line. 2004-09-13 Bud Davis <bdavis9659@comcast.net> PR fortran/17090 * gfortran.dg/pr17090.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@87474 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/pr17090.f9021
-rw-r--r--libgfortran/ChangeLog7
-rw-r--r--libgfortran/io/list_read.c7
4 files changed, 39 insertions, 1 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index b43b4881956..356701cfe42 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2004-09-13 Bud Davis <bdavis9659@comcast.net>
+
+ PR fortran/17090
+ * gfortran.dg/pr17090.f90: New test.
+
2004-09-13 Dale Johannesen <dalej@apple.com>
* gcc.c-torture/compile/pr17408.c: New test case.
diff --git a/gcc/testsuite/gfortran.dg/pr17090.f90 b/gcc/testsuite/gfortran.dg/pr17090.f90
new file mode 100644
index 00000000000..44dc5e40aaf
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr17090.f90
@@ -0,0 +1,21 @@
+! pr 17090 Runtime I/O error
+! bdavis9659@comcast.net
+! 9/12/2004
+! list directed read with spaces between the last data item and the
+! eoln cause missed data items.
+! this is a libgfortran test case
+ implicit none
+ integer i,sum
+ real a(14)
+ data sum / 0 /
+ open(unit=9,status='SCRATCH')
+ write(9,*)1.0,2.0,3.0,4.0,' '
+ write(9,*)5.0,6.0,7.0,8.0,' '
+ write(9,*)9.0,10.0,11.0,12.0,13.0,14.0,' '
+ rewind(9)
+ read(9,*)a
+ do i = 1,14
+ sum = sum + a(i)
+ end do
+ if (sum.ne.105) call abort
+ end
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 26a3544a49c..70e1469ebd7 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,10 @@
+2004-09-13 Bud Davis <bdavis9659@comcast.net>
+
+ PR fortran/17090
+
+ * io/list_read.c (list_formatted_read): Handle trailing spaces
+ at end of line.
+
2004-09-06 Steven G. Kargl <kargls@comcast.net>
* io/write.c (output_float): Typo in comment. Remove debugging
diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c
index f47d473df91..51767d07672 100644
--- a/libgfortran/io/list_read.c
+++ b/libgfortran/io/list_read.c
@@ -1270,7 +1270,12 @@ list_formatted_read (bt type, void *p, int len)
if (at_eol)
finish_separator ();
else
- eat_spaces ();
+ {
+ eat_spaces ();
+ /* trailing spaces prior to end of line */
+ if (at_eol)
+ finish_separator ();
+ }
saved_type = BT_NULL;
repeat_count = 1;