From 82ecca82af17fd6c172a75947a0c6cfbb255cdf6 Mon Sep 17 00:00:00 2001 From: bde Date: Sun, 12 Jul 1998 02:31:08 +0000 Subject: 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). --- usr.sbin/config/mkoptions.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'usr.sbin/config/mkoptions.c') diff --git a/usr.sbin/config/mkoptions.c b/usr.sbin/config/mkoptions.c index 16a2d8f..45e6780 100644 --- a/usr.sbin/config/mkoptions.c +++ b/usr.sbin/config/mkoptions.c @@ -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++; } } -- cgit v1.1