Test fix for crash and saving bug

pull/44/head
parent 560576aa57
commit 4915946675

@ -106,9 +106,21 @@ config_str yon_loaded_config_convert_to_save_command(struct loaded_config *targe
} else {
parameters_for_current_command = yon_char_unite(current->key,"=\'",(char*)current->data,"\'",NULL);
}
dictionary *sections_dict = (dictionary*)sections;
yon_dictionary_add_or_create_if_exists_with_data(sections_dict,current->section,parameters_for_current_command);
sections = realloc(sections_dict,sizeof(struct yon_temp_command_sections));
dictionary *sections_dict = NULL;
if (sections) sections_dict = yon_dictionary_get_last((dictionary*)sections);
sections = malloc(sizeof(struct yon_temp_command_sections));
sections->data=parameters_for_current_command;
sections->first=sections;
sections->key=yon_char_new(current->section);
sections->next=NULL;
sections->prev=NULL;
sections->status=0;
if (sections_dict){
sections_dict->next = (dictionary*)sections;
sections->prev=(struct yon_temp_command_sections*)sections_dict;
sections->first=(struct yon_temp_command_sections*)sections_dict->first;
}
// yon_dictionary_add_or_create_if_exists_with_data(sections_dict,current->section,parameters_for_current_command);
sections->status=yon_config_get_status(current->key);
}

Loading…
Cancel
Save