From owner-freebsd-bugs@FreeBSD.ORG Wed Jul 21 18:00:35 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D0D9D16A4CF; Wed, 21 Jul 2004 18:00:35 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id C862E43D1F; Wed, 21 Jul 2004 18:00:35 +0000 (GMT) (envelope-from harti@FreeBSD.org) Received: from freefall.freebsd.org (harti@localhost [127.0.0.1]) i6LI0Za9078380; Wed, 21 Jul 2004 18:00:35 GMT (envelope-from harti@freefall.freebsd.org) Received: (from harti@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i6LI0Y05078376; Wed, 21 Jul 2004 18:00:34 GMT (envelope-from harti) Date: Wed, 21 Jul 2004 18:00:34 GMT From: Hartmut Brandt Message-Id: <200407211800.i6LI0Y05078376@freefall.freebsd.org> To: jhs@jhs.muc.de, harti@FreeBSD.org, freebsd-bugs@FreeBSD.org, harti@FreeBSD.org Subject: Re: bin/25627: Cannot append hash after .elif in Makefile, (but can after .if) X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2004 18:00:35 -0000 Synopsis: Cannot append hash after .elif in Makefile, (but can after .if) State-Changed-From-To: suspended->open State-Changed-By: harti State-Changed-When: Wed Jul 21 17:51:06 GMT 2004 State-Changed-Why: I think I have a working patch. The problem with the original patch seems to be that the function in question (ParseSkipLine) is called from two places to do two entirely different things: with skip=true it is called from the conditional handling code to skip false .if contents until a line beginning with a dot is found. All input is discarded in this case. It is also called from the .for handling code to collect the for loop. In this case skip=false and the function will return the entire for loop. In the latter case we should not skip comments, because this must be done in the main code. Comment skipping is just a little bit more complex than just looking for a '#'. Think of: foo: echo '#define INET' >opt_inet.h harti Responsible-Changed-From-To: freebsd-bugs->harti Responsible-Changed-By: harti Responsible-Changed-When: Wed Jul 21 17:51:06 GMT 2004 Responsible-Changed-Why: I think I have a working patch. The problem with the original patch seems to be that the function in question (ParseSkipLine) is called from two places to do two entirely different things: with skip=true it is called from the conditional handling code to skip false .if contents until a line beginning with a dot is found. All input is discarded in this case. It is also called from the .for handling code to collect the for loop. In this case skip=false and the function will return the entire for loop. In the latter case we should not skip comments, because this must be done in the main code. Comment skipping is just a little bit more complex than just looking for a '#'. Think of: foo: echo '#define INET' >opt_inet.h harti http://www.freebsd.org/cgi/query-pr.cgi?pr=25627