From owner-freebsd-current@FreeBSD.ORG Fri Apr 14 02:12:30 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 90DC916A400 for ; Fri, 14 Apr 2006 02:12:30 +0000 (UTC) (envelope-from nike_d@cytexbg.com) Received: from server300.com (server300.com [216.35.196.26]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0980243D46 for ; Fri, 14 Apr 2006 02:12:29 +0000 (GMT) (envelope-from nike_d@cytexbg.com) Received: (qmail 7988 invoked by uid 502); 14 Apr 2006 02:12:29 -0000 Received: from unknown (HELO ?192.168.2.2?) (nike?d@24.34.92.125) by ns1.server300.com with (RC4-MD5 encrypted) SMTP; 14 Apr 2006 02:12:29 -0000 Message-ID: <443F0542.6090504@cytexbg.com> Date: Thu, 13 Apr 2006 22:13:22 -0400 From: Niki Denev User-Agent: Thunderbird 1.5 (X11/20060316) MIME-Version: 1.0 To: freebsd-current@freebsd.org X-Enigmail-Version: 0.94.0.0 OpenPGP: id=F2DB7EB9 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: [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 02:12:30 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 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); -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (FreeBSD) iD8DBQFEPwVCHNAJ/fLbfrkRAqHWAKCHet/41nm0ul9YNZOiIIhPsRLdIwCcCgD+ gJ28M700Ets7smQmTJJwwdA= =KkOb -----END PGP SIGNATURE-----