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
This commit is contained in:
Bud Davis 2005-01-30 13:16:19 +00:00 committed by Bud Davis
parent d6eabd43ee
commit 23e044cc1d
4 changed files with 39 additions and 1 deletions

View File

@ -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> 2005-01-29 Richard Guenther <richard.guenther@uni-tuebingen.de>
PR tree-optimization/15791 PR tree-optimization/15791

View File

@ -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

View File

@ -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> 2005-01-29 Thomas Koenig <Thomas.Koenig@online.de>
PR libfortran/19595 PR libfortran/19595

View File

@ -256,7 +256,7 @@ inquire_via_unit (gfc_unit * u)
internal_error ("inquire_via_unit(): Bad delim"); 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) if (ioparm.pad != NULL)