Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Apr 2006 11:21:28 +0400 (MSD)
From:      Maxim Konovalov <maxim@macomnet.ru>
To:        Niki Denev <nike_d@cytexbg.com>
Cc:        freebsd-current@freebsd.org
Subject:   Re: [patch] devd reporting funny line numbers on parsing failure
Message-ID:  <20060414112046.T22112@mp2.macomnet.net>
In-Reply-To: <443F0542.6090504@cytexbg.com>
References:  <443F0542.6090504@cytexbg.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060414112046.T22112>