[patch] devd reporting funny line numbers on parsing failure

From: Niki Denev <nike_d_at_cytexbg.com>
Date: Thu, 13 Apr 2006 22:13:22 -0400
-----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
_at__at_ -311,6 +311,7 _at__at_
	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-----
Received on Fri Apr 14 2006 - 00:12:30 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:54 UTC