[Mplayer-cvslog] CVS: main m_config.c,1.3,1.4
Arpi of Ize
arpi at mplayerhq.hu
Sat Jan 11 18:32:52 CET 2003
Update of /cvsroot/mplayer/main
In directory mail:/var/tmp.root/cvs-serv8615
Modified Files:
m_config.c
Log Message:
better error handling for invalud suboptions
Index: m_config.c
===================================================================
RCS file: /cvsroot/mplayer/main/m_config.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- m_config.c 11 Jan 2003 16:42:24 -0000 1.3
+++ m_config.c 11 Jan 2003 17:32:45 -0000 1.4
@@ -215,7 +215,7 @@
co = m_config_get_co(config,arg);
if(!co){
- mp_msg(MSGT_CFGPARSER, MSGL_ERR,"Unknown option: %s\n",arg);
+// mp_msg(MSGT_CFGPARSER, MSGL_ERR,"Unknown option: %s\n",arg);
return M_OPT_UNKNOW;
}
@@ -241,6 +241,7 @@
// Parse the child options
r = m_option_parse(co->opt,arg,param,&lst,config->mode);
// Set them now
+ if(r >= 0)
for(i = 0 ; lst && lst[2*i] ; i++) {
int l = strlen(co->name) + 1 + strlen(lst[2*i]) + 1;
if(r >= 0) {
@@ -248,7 +249,13 @@
char n[l];
sprintf(n,"%s:%s",co->name,lst[2*i]);
sr = m_config_parse_option(config,n,lst[2*i+1],set);
- if(sr < 0) r = sr;
+ if(sr < 0){
+ if(sr == M_OPT_UNKNOW){
+ mp_msg(MSGT_CFGPARSER, MSGL_ERR,"Error: option '%s' has no suboption '%s'\n",co->name,lst[2*i]);
+ r = M_OPT_INVALID;
+ } else
+ r = sr;
+ }
}
free(lst[2*i]);
free(lst[2*i+1]);
More information about the MPlayer-cvslog
mailing list