[Mplayer-cvslog] CVS: main cfgparser.c,1.37,1.38

Alex Beregszaszi alex at mplayer.dev.hu
Wed Dec 26 14:15:47 CET 2001


Update of /cvsroot/mplayer/main
In directory mplayer:/var/tmp.root/cvs-serv1682

Modified Files:
	cfgparser.c 
Log Message:
fixed subconfig parser

Index: cfgparser.c
===================================================================
RCS file: /cvsroot/mplayer/main/cfgparser.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- cfgparser.c	23 Dec 2001 21:18:06 -0000	1.37
+++ cfgparser.c	26 Dec 2001 13:15:44 -0000	1.38
@@ -245,6 +245,7 @@
 			int subconf_optnr;
 			struct config *subconf;
 			char *token;
+			int sscanf_ret;
 
 			if (param == NULL)
 				goto err_missing_param;
@@ -259,13 +260,17 @@
 			token = strtok(param, (char *)&(":"));
 			while(token)
 			{
-			    int sscanf_ret;
+			    /* clear out */
+			    subopt[0] = subparam[0] = 0;
 			    
+//			    sscanf_ret = sscanf(token, "%[^=]=%[^\n\0]", subopt, subparam);
 			    sscanf_ret = sscanf(token, "%[^=]=%s", subopt, subparam);
+
+			    mp_msg(MSGT_CFGPARSER, MSGL_DBG3, "token: '%s', i=%d, subopt='%s', subparam='%s' (ret: %d)\n", token, i, subopt, subparam, sscanf_ret);
 			    switch(sscanf_ret)
 			    {
 				case 1:
-				    subparam = NULL;
+				    subparam[0] = 0;
 				case 2:
 				    if ((ret = read_option((struct config *)subconf, subconf_optnr, subopt, subparam)) < 0)
 				    {
@@ -279,7 +284,6 @@
 				    ret = ERR_NOT_AN_OPTION;
 				    goto out;
 			    }
-			    mp_dbg(MSGT_CFGPARSER, MSGL_DBG3, "token: '%s', i=%d, subopt='%s, subparam='%s'\n", token, i, subopt, subparam);
 			    token = strtok(NULL, (char *)&(":"));
 			}
 




More information about the MPlayer-cvslog mailing list