diff m_config.c @ 13824:bad703951cf9

a few 10l fixes by Wei Jiang <jiangw98@yahoo.com>
author faust3
date Sun, 31 Oct 2004 10:27:40 +0000
parents 11b249ef87b0
children 63909962d3fc
line wrap: on
line diff
--- a/m_config.c	Sun Oct 31 08:35:27 2004 +0000
+++ b/m_config.c	Sun Oct 31 10:27:40 2004 +0000
@@ -32,7 +32,10 @@
 #endif
   
   while(i) {
-    sl = i->slots;
+    if (i->flags & M_CFG_OPT_ALIAS)
+      sl = NULL;
+    else
+      sl = i->slots;
     while(sl) {
       m_option_free(i->opt,sl->data);
       st = sl->prev;
@@ -43,7 +46,7 @@
       free(i->name);
     ct = i->next;
     free(i);
-    ct = i;
+    i = ct;
   }
   free(config);  
 }
@@ -149,6 +152,7 @@
   if(arg->type->flags & M_OPT_TYPE_HAS_CHILD) {
     m_option_t *ol = arg->p;
     int i;
+    co->slots = NULL;
     for(i = 0 ; ol[i].name != NULL ; i++)
       m_config_add_option(config,&ol[i], co->name);
   } else {
@@ -174,6 +178,7 @@
       m_option_set(arg,arg->p,sl->data);
     }
     sl->lvl = 0;
+    sl->prev = NULL;
     co->slots = (m_config_save_slot_t*)calloc(1,sizeof(m_config_save_slot_t) + arg->type->size);
     co->slots->prev = sl;
     co->slots->lvl = config->lvl;