summaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorpault <pault@138bc75d-0d04-0410-961f-82ee72b054a4>2005-07-13 18:43:14 +0000
committerpault <pault@138bc75d-0d04-0410-961f-82ee72b054a4>2005-07-13 18:43:14 +0000
commit75e6d81bbefb95382686bbac5de58bbb3cdb6017 (patch)
tree1c28fb5dafb8fc2f620f979446e0d67d6873cd05 /libgfortran
parent3e3a0a79c6d4fd4ce136737047f8bad349639526 (diff)
downloadgcc-75e6d81bbefb95382686bbac5de58bbb3cdb6017.tar.gz
2005-07-13 Paul Thomas <pault@gcc.gnu.org>
* io/read.c (read_complex): Prevent X formatting during reads from going beyond EOR to fix NIST fm908.FOR failure. * io/list_read.c (read_complex): Allow complex data in list- directed reads to have eols either side of the comma to fix NIST FM906.FOR failure. 2005-07-13 Paul Thomas <pault@gcc.gnu.org> * gfortran.dg/past_eor.f90: New. * gfortran.dg/complex_read.f90: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@101984 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/ChangeLog8
-rw-r--r--libgfortran/io/list_read.c14
-rw-r--r--libgfortran/io/read.c8
3 files changed, 28 insertions, 2 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 093043d7108..25f55c7398a 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,11 @@
+2005-07-13 Paul Thomas <pault@gcc.gnu.org>
+
+ * io/read.c (read_complex): Prevent X formatting during reads
+ from going beyond EOR to fix NIST fm908.FOR failure.
+ * io/list_read.c (read_complex): Allow complex data in list-
+ directed reads to have eols either side of the comma to
+ fix NIST FM906.FOR failure.
+
2005-07-12 Thomas Koenig <Thomas.Koenig@online.de>
PR libfortran/21593
diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c
index 3d62d8c845e..df99e7858a7 100644
--- a/libgfortran/io/list_read.c
+++ b/libgfortran/io/list_read.c
@@ -984,11 +984,25 @@ read_complex (int length)
if (parse_real (value, length))
return;
+eol_1:
eat_spaces ();
+ c = next_char ();
+ if (c == '\n' || c== '\r')
+ goto eol_1;
+ else
+ unget_char (c);
+
if (next_char () != ',')
goto bad_complex;
+eol_2:
eat_spaces ();
+ c = next_char ();
+ if (c == '\n' || c== '\r')
+ goto eol_2;
+ else
+ unget_char (c);
+
if (parse_real (value + length, length))
return;
diff --git a/libgfortran/io/read.c b/libgfortran/io/read.c
index 101652ca8dc..4cfad8d7785 100644
--- a/libgfortran/io/read.c
+++ b/libgfortran/io/read.c
@@ -784,8 +784,12 @@ read_f (fnode * f, char *dest, int length)
void
read_x (fnode * f)
{
- int n;
+ int n, m;
n = f->u.n;
- read_block (&n);
+ m = (int)current_unit->bytes_left;
+ if (f->format == FMT_X)
+ n = (n > m) ? m : n;
+ if (n)
+ read_block (&n);
}