diff options
author | Bud Davis <bdavis@gfortran.org> | 2005-01-30 13:16:19 +0000 |
---|---|---|
committer | Bud Davis <bdavis@gcc.gnu.org> | 2005-01-30 13:16:19 +0000 |
commit | 23e044cc1dc30da08dd53bddd70ca66cbb4ca6c4 (patch) | |
tree | f48b0371151e1ac6a864cb3626afc1d14b8ac5d6 | |
parent | d6eabd43eeb3637d28c370f97c9eb02c993c47d4 (diff) | |
download | gcc-23e044cc1dc30da08dd53bddd70ca66cbb4ca6c4.zip gcc-23e044cc1dc30da08dd53bddd70ca66cbb4ca6c4.tar.gz gcc-23e044cc1dc30da08dd53bddd70ca66cbb4ca6c4.tar.bz2 |
re PR libfortran/19647 (inquire(delim=) returns garbage)
2005-01-30 Bud Davis <bdavis@gfortran.org>
PR fortran/19647
* io/inquire.c (inquire_via_unit): Use correct variable for
pad.
* gfortan.dg/inquire_7.f90
From-SVN: r94439
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/inquire_7.f90 | 27 | ||||
-rw-r--r-- | libgfortran/ChangeLog | 6 | ||||
-rw-r--r-- | libgfortran/io/inquire.c | 2 |
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) |