# HG changeset patch # User alex # Date 1009142286 0 # Node ID 00bd914b6fb16a2468d39c0419b083ac54dd5fb6 # Parent 3bd222f2c1234f083b2f26dd6c54d6e2d97bcadd subconfig fix (if sscanf()==1, then null out second (non-present) parameter) and some errormessage fixes diff -r 3bd222f2c123 -r 00bd914b6fb1 cfgparser.c --- a/cfgparser.c Sun Dec 23 20:16:19 2001 +0000 +++ b/cfgparser.c Sun Dec 23 21:18:06 2001 +0000 @@ -79,7 +79,7 @@ } if (i == conf_optnr) { if (parser_mode == CONFIG_FILE) - mp_msg(MSGT_CFGPARSER, MSGL_ERR, "invalid option:\n"); + mp_msg(MSGT_CFGPARSER, MSGL_ERR, "invalid option: %s\n", opt); ret = ERR_NOT_AN_OPTION; goto out; } @@ -87,12 +87,12 @@ conf[i].name, conf[i].p, conf[i].type); if (conf[i].flags & CONF_NOCFG && parser_mode == CONFIG_FILE) { - mp_msg(MSGT_CFGPARSER, MSGL_ERR, "this option can only be used on command line:\n"); + mp_msg(MSGT_CFGPARSER, MSGL_ERR, "this option can only be used on command line: %s\n", opt); ret = ERR_NOT_AN_OPTION; goto out; } if (conf[i].flags & CONF_NOCMD && parser_mode == COMMAND_LINE) { - mp_msg(MSGT_CFGPARSER, MSGL_ERR, "this option can only be used in config file:\n"); + mp_msg(MSGT_CFGPARSER, MSGL_ERR, "this option can only be used in config file: %s\n", opt); ret = ERR_NOT_AN_OPTION; goto out; } @@ -265,6 +265,7 @@ switch(sscanf_ret) { case 1: + subparam = NULL; case 2: if ((ret = read_option((struct config *)subconf, subconf_optnr, subopt, subparam)) < 0) { @@ -297,7 +298,7 @@ out: return ret; err_missing_param: - mp_msg(MSGT_CFGPARSER, MSGL_ERR, "missing parameter: %s\n", param); + mp_msg(MSGT_CFGPARSER, MSGL_ERR, "missing parameter for option: %s\n", opt); ret = ERR_MISSING_PARAM; goto out; }