summaryrefslogtreecommitdiffstats
path: root/options/m_config.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2019-07-13 18:08:23 +0200
committerwm4 <wm4@nowhere>2019-09-19 20:37:05 +0200
commit0edccfd820e4812ed52cea85109f80ca13f74e97 (patch)
treeeb302813972aada094fcb8a6a455d68b66c1b785 /options/m_config.c
parentae797a21ec3ad0f5071911acf99efc56572d4fa3 (diff)
downloadmpv-0edccfd820e4812ed52cea85109f80ca13f74e97.tar.bz2
mpv-0edccfd820e4812ed52cea85109f80ca13f74e97.tar.xz
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.)
Diffstat (limited to 'options/m_config.c')
-rw-r--r--options/m_config.c6
1 files changed, 4 insertions, 2 deletions
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];