2005-01-29 Thomas Koenig <Thomas.Koenig@online.de>
authorpbrook <pbrook@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 29 Jan 2005 15:45:17 +0000 (15:45 +0000)
committerpbrook <pbrook@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 29 Jan 2005 15:45:17 +0000 (15:45 +0000)
PR libfortran/19595
* io/transfer.c (data_transfer_init): eor requires advance="NO".
testsuite/
* gfortran.dg/eor_1.f90:  New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@94410 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/eor_1.f90 [new file with mode: 0644]
libgfortran/ChangeLog
libgfortran/io/transfer.c

index edd525a..2fc135f 100644 (file)
@@ -1,3 +1,8 @@
+2005-01-29  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       PR libfortran/19595
+       * gfortran.dg/eor_1.f90:  New test.
+
 2005-01-29  Steven G. Kargl  <kargls@comcast.net>
 
        PR fortran/19589
diff --git a/gcc/testsuite/gfortran.dg/eor_1.f90 b/gcc/testsuite/gfortran.dg/eor_1.f90
new file mode 100644 (file)
index 0000000..c61a0b7
--- /dev/null
@@ -0,0 +1,10 @@
+! { dg do-run }
+! PR 19451: The test for advance='NO' with eor used to be reversed.
+program main
+  character*2 c
+  open(12, status='SCRATCH')
+  write(12, '(A)') '123', '456'
+  rewind(12)
+  read(12, '(A2)', advance='NO', eor=100) c
+100 continue
+end program main
index effa767..be7bfa8 100644 (file)
@@ -1,3 +1,8 @@
+2005-01-29  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       PR libfortran/19595
+       * io/transfer.c (data_transfer_init): eor requires advance="NO".
+
 2005-01-25  Tobias Schl"uter  <tobias.schlueter@physik.uni-muenchen.de>
 
        PR libfortran/19524
index c69d309..a55936f 100644 (file)
@@ -1041,7 +1041,7 @@ data_transfer_init (int read_flag)
 
   if (read_flag)
     {
-      if (ioparm.eor != 0 && advance_status == ADVANCE_NO)
+      if (ioparm.eor != 0 && advance_status != ADVANCE_NO)
        generate_error (ERROR_MISSING_OPTION,
                        "EOR specification requires an ADVANCE specification of NO");