This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[gfortran] patch for pr19647 inquire(..pad=..)


cut and paste error.

tested on i686/gnu/linux with no additional failures.


--bud



2005-01-28  Bud Davis  <bdavis9659@comcast.net>

	PR fortran/19647
	* io/inquire.c (inquire_via_unit): Use correct variable for
	pad.

Index: gcc/libgfortran/io/inquire.c
===================================================================
RCS file: /cvs/gcc/gcc/libgfortran/io/inquire.c,v
retrieving revision 1.8
diff -c -3 -p -r1.8 inquire.c
*** gcc/libgfortran/io/inquire.c	22 Jan 2005 03:51:12 -0000	1.8
--- gcc/libgfortran/io/inquire.c	28 Jan 2005 12:59:30 -0000
*************** inquire_via_unit (gfc_unit * u)
*** 256,262 ****
  	    internal_error ("inquire_via_unit(): Bad delim");
  	  }
  
!       cf_strcpy (ioparm.access, ioparm.access_len, p);
      }
  
    if (ioparm.pad != NULL)
--- 256,262 ----
  	    internal_error ("inquire_via_unit(): Bad delim");
  	  }
  
!       cf_strcpy (ioparm.delim, ioparm.delim_len, p);
      }
  
    if (ioparm.pad != NULL)



! { 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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]