From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4342 invoked by alias); 9 Jun 2007 19:28:08 -0000 Received: (qmail 4316 invoked by uid 48); 9 Jun 2007 19:27:59 -0000 Date: Sat, 09 Jun 2007 19:28:00 -0000 Message-ID: <20070609192759.4315.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/32235] gfortran - incorrectly position text file after backspace In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "jvdelisle at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-06/txt/msg00639.txt.bz2 ------- Comment #4 from jvdelisle at gcc dot gnu dot org 2007-06-09 19:27 ------- There are a couple of issues going on here. First, if the input file is a regular file which is seekable, gfortran is indeed giving the wrong result. This is because the endfile condition was not being set after an EOF error condition which is trapped in "subroutine inlist". This is easily fixed. (I have the patch tested) The second issue is that when using redirection with standard input, the file is not seekable and the results may depend on the underlying OS and buffering. I suspect that if you back spaced enough under the right conditions you would exhaust the buffer as you go back and will eventually fail. I will be giving this second issue some more thought. Especially since it works on g77 for at least the simple caee of a few backspaces. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32235