changeset 3761:b66a62f332d6

fixed subconfig parser
author alex
date Wed, 26 Dec 2001 13:15:44 +0000
parents b2e687236db2
children 6d9dcfa08611
files cfgparser.c
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/cfgparser.c	Wed Dec 26 12:32:40 2001 +0000
+++ b/cfgparser.c	Wed Dec 26 13:15:44 2001 +0000
@@ -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 *)&(":"));
 			}