summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortobi <tobi@138bc75d-0d04-0410-961f-82ee72b054a4>2005-09-30 18:47:54 +0000
committertobi <tobi@138bc75d-0d04-0410-961f-82ee72b054a4>2005-09-30 18:47:54 +0000
commit36592fa991a4c4f5a91c170338df26274903e430 (patch)
tree49646f39944d33cfef8f86c09e2141a3106a4783
parent535e833b7cd413b3faab0c3b5b8ef1dd9a160deb (diff)
downloadgcc-36592fa991a4c4f5a91c170338df26274903e430.tar.gz
2005-09-30 Janne Blomqvist <jblomqvi@cc.hut.fi>
libgfortran/ PR 24112 * io/open.c (edit_modes): Check for correct flag. gcc/testsuite/ PR 24112 * gfortran.dg/open_status_1.f90: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@104829 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/open_status_1.f908
-rw-r--r--libgfortran/ChangeLog5
-rw-r--r--libgfortran/io/open.c2
4 files changed, 19 insertions, 1 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 97ac0baeb15..65f59579100 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2005-09-30 Janne Blomqvist <jblomqvi@cc.hut.fi>
+
+ PR 24112
+ * gfortran.dg/open_status_1.f90: New.
+
2005-09-30 Uros Bizjak <uros@kss-loka.si>
* gcc.dg/vect/fast-math-vect-reduc-7.c: Clean up temp files.
diff --git a/gcc/testsuite/gfortran.dg/open_status_1.f90 b/gcc/testsuite/gfortran.dg/open_status_1.f90
new file mode 100644
index 00000000000..df44a4461a8
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/open_status_1.f90
@@ -0,0 +1,8 @@
+! { dg-do run }
+! Test reopening with io status='old'
+program iostatus
+ open (1, file='foo', status='replace') ! Make sure file exists.
+ open (1, file='foo', status='old')
+ open (1, file='foo', status='old')
+ close (1, status='delete')
+end program iostatus
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index fa76b5ef039..07b2e913c7c 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,8 @@
+2005-09-30 Janne Blomqvist <jblomqvi@cc.hut.fi>
+
+ PR 24112
+ * io/open.c (edit_modes): Check for correct flag.
+
2005-09-29 Jakub Jelinek <jakub@redhat.com>
* runtime/string.c (find_option): Change 3rd argument to
diff --git a/libgfortran/io/open.c b/libgfortran/io/open.c
index 82d5a355e0d..e1e42ad9370 100644
--- a/libgfortran/io/open.c
+++ b/libgfortran/io/open.c
@@ -120,7 +120,7 @@ edit_modes (gfc_unit * u, unit_flags * flags)
/* Complain about attempts to change the unchangeable. */
if (flags->status != STATUS_UNSPECIFIED &&
- u->flags.status != flags->position)
+ u->flags.status != flags->status)
generate_error (ERROR_BAD_OPTION,
"Cannot change STATUS parameter in OPEN statement");