From e4dc453ea095c1c3e282d5b6cc1370c74abb76cf Mon Sep 17 00:00:00 2001 From: albeu Date: Sun, 13 Apr 2008 19:18:51 +0000 Subject: Replace the trivial command line preparser with a more robust version allowing all kind of options to be used. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26440 b3059339-0415-0410-9bf9-f77b7e298cf2 --- m_config.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'm_config.c') diff --git a/m_config.c b/m_config.c index c030b13233..263144813e 100644 --- a/m_config.c +++ b/m_config.c @@ -308,6 +308,13 @@ m_config_parse_option(m_config_t *config, char* arg, char* param,int set) { mp_msg(MSGT_CFGPARSER, MSGL_ERR,MSGTR_InvalidCmdlineOption,arg); return M_OPT_INVALID; } + // During command line preparse set only pre-parse options + // Otherwise only set pre-parse option if they were not already set. + if(((config->mode == M_COMMAND_LINE_PRE_PARSE) && + !(co->opt->flags & M_OPT_PRE_PARSE)) || + ((config->mode != M_COMMAND_LINE_PRE_PARSE) && + (co->opt->flags & M_OPT_PRE_PARSE) && (co->flags & M_CFG_OPT_SET))) + set = 0; // Option with children are a bit different to parse if(co->opt->type->flags & M_OPT_TYPE_HAS_CHILD) { -- cgit v1.2.3