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:
Kyle Evans 2018-12-22 06:08:06 +00:00
parent 993e5c4fd2
commit ac0a7e2a3c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=342363

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);