From 23e044cc1dc30da08dd53bddd70ca66cbb4ca6c4 Mon Sep 17 00:00:00 2001 From: Bud Davis Date: Sun, 30 Jan 2005 13:16:19 +0000 Subject: re PR libfortran/19647 (inquire(delim=) returns garbage) 2005-01-30 Bud Davis PR fortran/19647 * io/inquire.c (inquire_via_unit): Use correct variable for pad. * gfortan.dg/inquire_7.f90 From-SVN: r94439 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gfortran.dg/inquire_7.f90 | 27 +++++++++++++++++++++++++++ libgfortran/ChangeLog | 6 ++++++ libgfortran/io/inquire.c | 2 +- 4 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gfortran.dg/inquire_7.f90 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 + + PR fortran/19647 + * gfortan.dg/inquire_7.f90 + 2005-01-29 Richard Guenther 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 + + PR fortran/19647 + * io/inquire.c (inquire_via_unit): Use correct variable for + pad. + 2005-01-29 Thomas Koenig 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) -- cgit v1.1