From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14755 invoked by alias); 18 Aug 2011 09:12:09 -0000 Received: (qmail 14744 invoked by uid 22791); 18 Aug 2011 09:12:08 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 18 Aug 2011 09:11:54 +0000 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/50109] [4.3/4.4/4.5/4.6 Regression] Formatted namelist read with multiple "!" fails with: Cannot match namelist object name ! Date: Thu, 18 Aug 2011 09:37:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: burnus at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.5.4 X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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: 2011-08/txt/msg01561.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50109 --- Comment #4 from Tobias Burnus 2011-08-18 09:11:21 UTC --- Draft patch: --- a/libgfortran/io/list_read.c +++ b/libgfortran/io/list_read.c @@ -345,28 +345,19 @@ eat_separator (st_parameter_dt *dtp) do { if ((c = next_char (dtp)) == EOF) return LIBERROR_END; if (c == '!') { err = eat_line (dtp); if (err) return err; - if ((c = next_char (dtp)) == EOF) - return LIBERROR_END; - if (c == '!') - { - err = eat_line (dtp); - if (err) - return err; - if ((c = next_char (dtp)) == EOF) - return LIBERROR_END; - } + c = '\n'; } } while (c == '\n' || c == '\r' || c == ' ' || c == '\t'); unget_char (dtp, c); } break; case '!': if (dtp->u.p.namelist_mode)