aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/inquire_7.f9027
-rw-r--r--libgfortran/ChangeLog6
-rw-r--r--libgfortran/io/inquire.c2
4 files changed, 39 insertions, 1 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 88725cb..37bcc5b 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2005-01-30 Bud Davis <bdavis@gfortran.org>
+
+ PR fortran/19647
+ * gfortan.dg/inquire_7.f90
+
2005-01-29 Richard Guenther <richard.guenther@uni-tuebingen.de>
PR tree-optimization/15791
diff --git a/gcc/testsuite/gfortran.dg/inquire_7.f90 b/gcc/testsuite/gfortran.dg/inquire_7.f90
new file mode 100644
index 0000000..02e96ab
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/inquire_7.f90
@@ -0,0 +1,27 @@
+! { dg-do run }
+! pr 19647 / segfault on inquire(..pad=..)
+! Thomas.Koenig@online.de
+! bdavis9659@comcast.net
+ program main
+ character(len=10) delim
+! quote
+ open(10,delim='quote',status='SCRATCH')
+ inquire(10,delim=delim)
+ close(10)
+ if (delim .ne. 'QUOTE') call abort
+! apostrophe
+ open(10,delim='apostrophe',status='SCRATCH')
+ inquire(10,delim=delim)
+ close(10)
+ if (delim .ne. 'APOSTROPHE') call abort
+! none
+ open(10,status='SCRATCH')
+ inquire(10,delim=delim)
+ close(10)
+ if (delim .ne. 'NONE') call abort
+! undefined
+ open(10,form='UNFORMATTED',status='SCRATCH')
+ inquire(10,delim=delim)
+ close(10)
+ if (delim .ne. 'UNDEFINED') call abort
+ end program main
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index be7bfa8..d0aabea 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,9 @@
+2005-01-30 Bud Davis <bdavis@gfortran.org>
+
+ PR fortran/19647
+ * io/inquire.c (inquire_via_unit): Use correct variable for
+ pad.
+
2005-01-29 Thomas Koenig <Thomas.Koenig@online.de>
PR libfortran/19595
diff --git a/libgfortran/io/inquire.c b/libgfortran/io/inquire.c
index 20fa8b3..28c2f6a 100644
--- a/libgfortran/io/inquire.c
+++ b/libgfortran/io/inquire.c
@@ -256,7 +256,7 @@ inquire_via_unit (gfc_unit * u)
internal_error ("inquire_via_unit(): Bad delim");
}
- cf_strcpy (ioparm.access, ioparm.access_len, p);
+ cf_strcpy (ioparm.delim, ioparm.delim_len, p);
}
if (ioparm.pad != NULL)