From owner-freebsd-current@FreeBSD.ORG Fri Apr 14 07:21:32 2006 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4B86816A400 for ; Fri, 14 Apr 2006 07:21:32 +0000 (UTC) (envelope-from maxim@macomnet.ru) Received: from mp2.macomnet.net (mp2.macomnet.net [195.128.64.6]) by mx1.FreeBSD.org (Postfix) with ESMTP id B3C2443D49 for ; Fri, 14 Apr 2006 07:21:31 +0000 (GMT) (envelope-from maxim@macomnet.ru) Received: from localhost (localhost [127.0.0.1]) by mp2.macomnet.net (8.13.4/8.13.3) with ESMTP id k3E7LSwn023491; Fri, 14 Apr 2006 11:21:28 +0400 (MSD) (envelope-from maxim@macomnet.ru) Date: Fri, 14 Apr 2006 11:21:28 +0400 (MSD) From: Maxim Konovalov To: Niki Denev In-Reply-To: <443F0542.6090504@cytexbg.com> Message-ID: <20060414112046.T22112@mp2.macomnet.net> References: <443F0542.6090504@cytexbg.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: freebsd-current@freebsd.org Subject: Re: [patch] devd reporting funny line numbers on parsing failure X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2006 07:21:32 -0000 Hi Niki, > This fixes devd reporting funny line numbers when > there are more than one config files to be parsed. > Basically "lineno" is being incremented on every new line in > every config file, so if you have unparsable line in a > config file then devd will report that the unparsable line > number is the number of the total parsed lines from all config files > so far and not the line number from the beginning of the file being > parsed. > > > - --- devd.cc. Thu Apr 13 22:02:14 2006 > +++ devd.cc.fixed. Thu Apr 13 22:01:29 2006 > @@ -311,6 +311,7 @@ > yyin = fopen(fn, "r"); > if (yyin == NULL) > err(1, "Cannot open config file %s", fn); > + lineno = 1; > if (yyparse() != 0) > errx(1, "Cannot parse %s at line %d", fn, lineno); > fclose(yyin); Fixed in HEAD. Thanks! -- Maxim Konovalov