From: Jerry DeLisle Date: Sat, 5 Jan 2008 16:00:40 +0000 (+0000) Subject: re PR fortran/34676 (IO error delayed) X-Git-Tag: releases/gcc-4.3.0~744 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa347f22327d1521dce3327fb1e6cc5d43d1b79d;p=thirdparty%2Fgcc.git re PR fortran/34676 (IO error delayed) 2008-01-05 Jerry DeLisle PR libfortran/34676 * io/list_read.c (next_char): Only save the EOF condition for later if advance="no". From-SVN: r131337 --- diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index c15f5d550507..2d276f63a2c7 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,9 @@ +2008-01-05 Jerry DeLisle + + PR libfortran/34676 + * io/list_read.c (next_char): Only save the EOF condition for later if + advance="no". + 2008-01-03 Thomas Koenig PR libfortran/34565 diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c index f00fb77394b7..f1d0e6961e1f 100644 --- a/libgfortran/io/list_read.c +++ b/libgfortran/io/list_read.c @@ -236,10 +236,15 @@ next_char (st_parameter_dt *dtp) } if (length == 0) { - if (dtp->u.p.current_unit->endfile == AT_ENDFILE) + if (dtp->u.p.advance_status == ADVANCE_NO) + { + if (dtp->u.p.current_unit->endfile == AT_ENDFILE) + longjmp (*dtp->u.p.eof_jump, 1); + dtp->u.p.current_unit->endfile = AT_ENDFILE; + c = '\n'; + } + else longjmp (*dtp->u.p.eof_jump, 1); - dtp->u.p.current_unit->endfile = AT_ENDFILE; - c = '\n'; } else c = *p;