From 4a3050fc468b5a36c506f74a99823e3b63e79faf Mon Sep 17 00:00:00 2001 From: Maxim Konovalov Date: Fri, 14 Apr 2006 07:20:42 +0000 Subject: [PATCH] o Yacc's lineno variable holds a total number of parsed lines. Reset it to 1 for each devd config file so if the parser finds a syntax error devd(8) will report a correct line number. Submitted by: Niki Denev MFC after: 2 weeks --- sbin/devd/devd.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/sbin/devd/devd.cc b/sbin/devd/devd.cc index 3dadde4f31e2..5856874cc45f 100644 --- a/sbin/devd/devd.cc +++ b/sbin/devd/devd.cc @@ -311,6 +311,7 @@ config::parse_one_file(const char *fn) 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);