aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/config/config.y
diff options
context:
space:
mode:
authorBruce Evans <bde@FreeBSD.org>1998-07-12 02:18:41 +0000
committerBruce Evans <bde@FreeBSD.org>1998-07-12 02:18:41 +0000
commitf59d2e0292da05b1c52d25f62a55a3b368113bad (patch)
treea5ced22f31e250e3ef91a5ac8a568c973c05d124 /usr.sbin/config/config.y
parent95de6ecfe80f604d6ed8e74fc90f903372e5d7ae (diff)
downloadsrc-f59d2e0292da05b1c52d25f62a55a3b368113bad.tar.gz
src-f59d2e0292da05b1c52d25f62a55a3b368113bad.zip
Fixed off-by-1 errors in option line numbers. yyline is 0-based, but
was used as if it is 1-based. This happened to give the correct result for options without values because of a compensating error in newline lexing. Didn't fix the latter, so line numbers in yyerror() may still be 1 too high in some cases.
Notes
Notes: svn path=/head/; revision=37576
Diffstat (limited to 'usr.sbin/config/config.y')
-rw-r--r--usr.sbin/config/config.y8
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.sbin/config/config.y b/usr.sbin/config/config.y
index 845ee657ceb2..04757a9d23c9 100644
--- a/usr.sbin/config/config.y
+++ b/usr.sbin/config/config.y
@@ -414,6 +414,10 @@ Option:
op->op_name = $1;
op->op_next = opt;
op->op_value = 0;
+ /*
+ * op->op_line is 1-based; yyline is 0-based but is now 1
+ * larger than when `Save_id' was lexed.
+ */
op->op_line = yyline;
opt = op;
if ((s = strchr(op->op_name, '='))) {
@@ -429,7 +433,7 @@ Option:
op->op_name = $1;
op->op_next = opt;
op->op_value = $3;
- op->op_line = yyline;
+ op->op_line = yyline + 1;
opt = op;
} ;
@@ -464,7 +468,7 @@ Mkoption:
op->op_ownfile = 0; /* for now */
op->op_next = mkopt;
op->op_value = $3;
- op->op_line = yyline;
+ op->op_line = yyline + 1;
mkopt = op;
} ;