diff options
author | maxim <maxim@FreeBSD.org> | 2006-04-14 07:20:42 +0000 |
---|---|---|
committer | maxim <maxim@FreeBSD.org> | 2006-04-14 07:20:42 +0000 |
commit | 4c7363828c554097c72b295689dbc88b763ac63d (patch) | |
tree | 4bbbb9de4eec74b92e3582b6a582aa628bbb77dd /sbin/devd | |
parent | 9e131242ef09dde358b968e098233e7dd8f59537 (diff) | |
download | FreeBSD-src-4c7363828c554097c72b295689dbc88b763ac63d.zip FreeBSD-src-4c7363828c554097c72b295689dbc88b763ac63d.tar.gz |
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
Diffstat (limited to 'sbin/devd')
-rw-r--r-- | sbin/devd/devd.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sbin/devd/devd.cc b/sbin/devd/devd.cc index 3dadde4..5856874 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); |