Browse Source

Fix default sym resolve mechanism

Serj Kalichev 11 years ago
parent
commit
907a9c36f8
2 changed files with 8 additions and 5 deletions
  1. 4 5
      clish/shell/shell_new.c
  2. 4 0
      clish/shell/shell_xml.c

+ 4 - 5
clish/shell/shell_new.c

@@ -22,7 +22,6 @@ static void clish_shell_init(clish_shell_t * this,
 {
 	clish_ptype_t *tmp_ptype = NULL;
 	clish_plugin_t *plugin = NULL;
-	clish_sym_t *sym = NULL;
 
 	/* initialise the tree of views */
 	lub_bintree_init(&this->view_tree,
@@ -47,10 +46,10 @@ static void clish_shell_init(clish_shell_t * this,
 
 	/* Initialise the list of unresolved (yet) symbols */
 	this->syms = lub_list_new(clish_sym_compare);
-	/* Add default sym and save it to shell structure */
-	sym = clish_shell_add_unresolved_sym(this,
-		CLISH_DEFAULT_SYM, CLISH_SYM_TYPE_FN);
-	this->default_sym = sym;
+
+	/* Add default syms and save them to shell structure */
+	this->default_sym = clish_sym_new(
+		CLISH_DEFAULT_SYM, NULL, CLISH_SYM_TYPE_FN);
 
 	assert(NULL != hooks);
 

+ 4 - 0
clish/shell/shell_xml.c

@@ -138,6 +138,10 @@ int clish_shell_load_scheme(clish_shell_t *this, const char *xml_path)
 	}
 	/* tidy up */
 	lub_string_free(buffer);
+
+	/* Add default syms to unresolved table */
+	lub_list_add(this->syms, this->default_sym);
+
 #ifdef DEBUG
 	clish_shell_dump(this);
 #endif