an entry in struct early_default is set or not. Add a "set" member
and use that instead.
struct early_default {
const char *var;
const char *val;
- int op;
+ short op;
+ short set;
};
static struct early_default early_defaults[] = {
default_binding_matches(def, what)) {
early->val = def->val;
early->op = def->op;
+ early->set = true;
}
debug_return_bool(true);
}
debug_decl(apply_early_defaults, SUDOERS_DEBUG_DEFAULTS)
for (early = early_defaults; early->var != NULL; early++) {
- if (early->val != NULL) {
+ if (early->set) {
if (!set_default(early->var, early->val, early->op, quiet))
rc = false;
- early->val = NULL; /* clean state for next run */
+ early->set = false; /* clean state for next run */
}
}
debug_return_bool(rc);