Fixed crash

pull/132/head
parent 64418fae07
commit c6f7c2dcd8
No known key found for this signature in database
GPG Key ID: FF1D842BF4DDE92B

@ -38,7 +38,10 @@ void yon_repo_fill_archs(repo_struct *repo){
int size; int size;
config_str folders = yon_dir_get_contents(repo->path,&size); config_str folders = yon_dir_get_contents(repo->path,&size);
for (int i=0;i<size;i++){ for (int i=0;i<size;i++){
if (yon_file_is_directory(folders[i])&&(strcmp(folders[i],".")&&strcmp(folders[i],".."))){ char *full_path = yon_char_unite(repo->path,"/",folders[i],NULL);
if (yon_file_is_directory(full_path)&&
(strcmp(folders[i],".")&&
strcmp(folders[i],".."))){
arch_struct *arch = yon_arch_struct_new(); arch_struct *arch = yon_arch_struct_new();
arch->name = yon_char_new(folders[i]); arch->name = yon_char_new(folders[i]);
arch->path = yon_char_unite(repo->path,"/",arch->name,NULL); arch->path = yon_char_unite(repo->path,"/",arch->name,NULL);
@ -47,6 +50,7 @@ void yon_repo_fill_archs(repo_struct *repo){
yon_arch_fill_packages(arch); yon_arch_fill_packages(arch);
g_hash_table_insert(repo->archs,arch->name,arch); g_hash_table_insert(repo->archs,arch->name,arch);
} }
free(full_path);
} }
} }

@ -53,12 +53,12 @@ void on_storage_open(GtkWidget *self, storage_config_window *window){
int exist_size=0; int exist_size=0;
config_str exist_storages = (config_str)g_hash_table_get_keys_as_array(main_config.storages,&exist_size); config_str exist_storages = (config_str)g_hash_table_get_keys_as_array(main_config.storages,&exist_size);
for (int i=0;i<exist_size;i++){ for (int i=0;i<exist_size;i++){
printf("%s -- %s\n",filename,exist_storages[i]);
if (strstr(filename,exist_storages[i])){ if (strstr(filename,exist_storages[i])){
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),INSIDE_STORAGE_ERROR_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),INSIDE_STORAGE_ERROR_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
return; return;
} }
} }
yon_char_parsed_free(exist_storages,exist_size);
storage_struct *storage = yon_storage_struct_new(); storage_struct *storage = yon_storage_struct_new();
storage->path=dialog->last_success_selection; storage->path=dialog->last_success_selection;
storage->name = yon_char_new(storage->path); storage->name = yon_char_new(storage->path);

Loading…
Cancel
Save