diff options
author | bde <bde@FreeBSD.org> | 1998-07-12 02:18:41 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1998-07-12 02:18:41 +0000 |
commit | aa863717b9318186635eba0c68827438ae6e38de (patch) | |
tree | ecc3c7dd998ca428a03c9bb8eaa89e2aeee35c4d /usr.sbin/config | |
parent | 640d4c991a826d7817c10c61a74249bcd92fdff4 (diff) | |
download | FreeBSD-src-aa863717b9318186635eba0c68827438ae6e38de.zip FreeBSD-src-aa863717b9318186635eba0c68827438ae6e38de.tar.gz |
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.
Diffstat (limited to 'usr.sbin/config')
-rw-r--r-- | usr.sbin/config/config.y | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.sbin/config/config.y b/usr.sbin/config/config.y index 845ee65..04757a9 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; } ; |