config(8): Remove all instances of an option when opting out

Quick follow-up to r342362: options can appear multiple times now, so
clean up all of them as needed. For non-OPTIONS options, this has no effect
since they're already de-duplicated.

MFC after:	1 week
X-MFC-With:	r342362
This commit is contained in:
kevans 2018-12-22 06:08:06 +00:00
parent 2d80e14b1b
commit 1cbd030b6d

View File

@ -479,8 +479,7 @@ rmopt_schedule(struct opt_head *list, char *name)
{
struct opt *op;
op = findopt(list, name);
if (op != NULL) {
while ((op = findopt(list, name)) != NULL) {
SLIST_REMOVE(list, op, opt, op_next);
free(op->op_name);
free(op);