From 0edccfd820e4812ed52cea85109f80ca13f74e97 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 13 Jul 2019 18:08:23 +0200 Subject: 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.) --- options/m_config.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'options/m_config.c') diff --git a/options/m_config.c b/options/m_config.c index 4eda265eba..7085d3d6fa 100644 --- a/options/m_config.c +++ b/options/m_config.c @@ -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]; -- cgit v1.2.3