libutil/config: fix appendable options not getting marked as overridden

Commit 4dbbd721eb intended to mark all settings
as overridden when they are. Unfortunately, due to an oversight, this marking
was accidentally performed in the implementation details of non-appendable
options. Move it to the common codepath so that it works for appendable options
too.

Fixes: #573
Change-Id: Idc3402bac48b19d832acd9b553e16e5791470c26
This commit is contained in:
alois31 2024-11-09 12:08:24 +01:00
parent 116895acb1
commit 08a362a540
Signed by: alois31
GPG key ID: E0F59EA5E5216914

View file

@ -64,8 +64,6 @@ void BaseSetting<T>::appendOrSet(T newValue, bool append, const ApplyConfigOptio
!trait::appendable,
"using default `appendOrSet` implementation with an appendable type");
assert(!append);
overridden = true;
value = std::move(newValue);
}
@ -77,6 +75,7 @@ void BaseSetting<T>::set(const std::string & str, bool append, const ApplyConfig
if (deprecated && (append || parsed != value)) {
warn("deprecated setting '%s' found (set to '%s')", name, str);
}
overridden = true;
appendOrSet(std::move(parsed), append, options);
} else {
assert(experimentalFeature);