From 41763b6d5626a66b063e016200c68fed2adb5e63 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 18 Feb 2013 17:01:25 +0100 Subject: parser-cfg: fix profile-desc Printed "error parsing option profile-desc=..." when using that inside of profile sections. This happened because we now check the presence of an option before setting it, and profile-desc is not an option, but special cased in the config parser. --- core/parser-cfg.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'core') diff --git a/core/parser-cfg.c b/core/parser-cfg.c index 5d63d27c52..8f90d3f5e6 100644 --- a/core/parser-cfg.c +++ b/core/parser-cfg.c @@ -200,6 +200,11 @@ int m_config_parse_config_file(m_config_t *config, const char *conffile) bstr bopt = bstr0(opt); bstr bparam = bstr0(param); + if (profile && bstr_equals0(bopt, "profile-desc")) { + m_profile_set_desc(profile, param); + goto nextline; + } + tmp = m_config_option_requires_param(config, bopt); if (tmp > 0 && !param_set) tmp = M_OPT_MISSING_PARAM; @@ -212,11 +217,7 @@ int m_config_parse_config_file(m_config_t *config, const char *conffile) } if (profile) { - if (!strcmp(opt, "profile-desc")) - m_profile_set_desc(profile, param); - else - tmp = m_config_set_profile_option(config, profile, - bopt, bparam); + tmp = m_config_set_profile_option(config, profile, bopt, bparam); } else { tmp = m_config_set_option_ext(config, bopt, bparam, M_SETOPT_FROM_CONFIG_FILE); -- cgit v1.2.3