mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-17 15:27:36 +00:00
Warn about redefined options. Keep using the last value processed.
Options are processed reverse file order, so the first definition in the config file wins (except for directives that are converted to option).
This commit is contained in:
parent
f59d2e0292
commit
d8dd03ae32
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=37577
@ -37,7 +37,7 @@
|
||||
static char sccsid[] = "@(#)mkheaders.c 8.1 (Berkeley) 6/6/93";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$Id$";
|
||||
"$Id: mkoptions.c,v 1.6 1997/09/15 06:37:10 charnier Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
/*
|
||||
@ -103,9 +103,15 @@ do_option(name)
|
||||
value = NULL;
|
||||
for (op = opt; op; op = op->op_next) {
|
||||
if (eq(name, op->op_name)) {
|
||||
oldvalue = value;
|
||||
value = op->op_value;
|
||||
if (!value)
|
||||
if (value == NULL)
|
||||
value = ns("1");
|
||||
if (oldvalue != NULL && !eq(value, oldvalue))
|
||||
printf(
|
||||
"%s:%d: option \"%s\" redefined from %s to %s\n",
|
||||
PREFIX, op->op_line, op->op_name, oldvalue,
|
||||
value);
|
||||
op->op_ownfile++;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user