summaryrefslogtreecommitdiffstats
path: root/cfgparser.c
diff options
context:
space:
mode:
authoralex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-12-23 21:18:06 +0000
committeralex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-12-23 21:18:06 +0000
commite99c45c97d4153a7ac957df144e27ab0ea267222 (patch)
tree74b46a40bcba9fd26b3984db9f8c4fe1b2619393 /cfgparser.c
parent025462b12ac4a7ad3ac2d770fdebb713cd58fb39 (diff)
downloadmpv-e99c45c97d4153a7ac957df144e27ab0ea267222.tar.bz2
mpv-e99c45c97d4153a7ac957df144e27ab0ea267222.tar.xz
subconfig fix (if sscanf()==1, then null out second (non-present) parameter) and some errormessage fixes
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3685 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'cfgparser.c')
-rw-r--r--cfgparser.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/cfgparser.c b/cfgparser.c
index 80438a8d2a..ea7c1c3ff0 100644
--- a/cfgparser.c
+++ b/cfgparser.c
@@ -79,7 +79,7 @@ static int read_option(struct config *conf, int conf_optnr, char *opt, char *par
}
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 @@ static int read_option(struct config *conf, int conf_optnr, char *opt, char *par
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 @@ static int read_option(struct config *conf, int conf_optnr, char *opt, char *par
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 @@ static int read_option(struct config *conf, int conf_optnr, char *opt, char *par
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;
}