m_config: add assertion to a specific case

It seems using multiple prefixes for an option isn't supported out of
laziness (and shouldn't, because what the fuck). So assert() on this.

(Unfortunately this prefix nonsense is still needed. Especially AO and
VO options use this through the options_prefix field.)
This commit is contained in:
wm4 2019-07-13 18:08:23 +02:00
parent ae797a21ec
commit 0edccfd820
1 changed files with 4 additions and 2 deletions

View File

@ -542,10 +542,12 @@ static void add_sub_group(struct m_config *config, const char *name_prefix,
.parent_ptr = parent_ptr,
};
if (subopts->prefix && subopts->prefix[0])
name_prefix = subopts->prefix;
if (!name_prefix)
name_prefix = "";
if (subopts->prefix && subopts->prefix[0]) {
assert(!name_prefix[0]);
name_prefix = subopts->prefix;
}
for (int i = 0; subopts->opts && subopts->opts[i].name; i++) {
const struct m_option *opt = &subopts->opts[i];