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]

Re: gfortran patch for PR 18778 Abort on endfile on unopened unit


On Saturday 01 January 2005 01:50, Bud Davis wrote:
> RCS file: /cvs/gcc/gcc/libgfortran/io/transfer.c,v
> retrieving revision 1.23
> diff -c -3 -p -r1.23 transfer.c
> *** gcc/libgfortran/io/transfer.c 24 Dec 2004 00:29:07 -0000 1.23
> --- gcc/libgfortran/io/transfer.c 24 Dec 2004 03:23:05 -0000
> *************** us_read (void)
> *** 834,839 ****
> --- 834,842 ----
>     n = sizeof (gfc_offset);
>     p = salloc_r (current_unit->s, &n);
>
> +   if (n == 0)
> +     return;  /* end of file */
> +
>     if (p == NULL || n != sizeof (gfc_offset))
>       {
>         generate_error (ERROR_BAD_US, NULL);

Ok.

Paul


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