# HG changeset patch # User arpi # Date 1044198416 0 # Node ID d3da9b617aa898b4d345cb25a9f19e37956f7a47 # Parent e9707479087c4b2847349c260d8a82e208b197f0 print meaningful error message for missing parameter noticed by Colin Leroy diff -r e9707479087c -r d3da9b617aa8 m_config.c --- a/m_config.c Sun Feb 02 14:02:32 2003 +0000 +++ b/m_config.c Sun Feb 02 15:06:56 2003 +0000 @@ -254,6 +254,10 @@ mp_msg(MSGT_CFGPARSER, MSGL_ERR,"Error: option '%s' has no suboption '%s'\n",co->name,lst[2*i]); r = M_OPT_INVALID; } else + if(sr == M_OPT_MISSING_PARAM){ + mp_msg(MSGT_CFGPARSER, MSGL_ERR,"Error: suboption '%s' of '%s' must have a parameter!\n",lst[2*i],co->name); + r = M_OPT_INVALID; + } else r = sr; } } @@ -284,8 +288,14 @@ int m_config_check_option(m_config_t *config, char* arg, char* param) { + int r; mp_msg(MSGT_CFGPARSER, MSGL_DBG2,"Checking %s=%s\n",arg,param); - return m_config_parse_option(config,arg,param,0); + r=m_config_parse_option(config,arg,param,0); + if(r==M_OPT_MISSING_PARAM){ + mp_msg(MSGT_CFGPARSER, MSGL_ERR,"Error: option '%s' must have a parameter!\n",arg); + return M_OPT_INVALID; + } + return r; }