diff --git a/workbench/src/plugin_main.c b/workbench/src/plugin_main.c index adfaf84b0..c233272aa 100644 --- a/workbench/src/plugin_main.c +++ b/workbench/src/plugin_main.c @@ -128,7 +128,7 @@ void geany_load_module(GeanyPlugin *plugin) /* Set metadata */ plugin->info->name = _("Workbench"); plugin->info->description = _("Manage and customize multiple projects."); - plugin->info->version = "1.0"; + plugin->info->version = "1.01"; plugin->info->author = "LarsGit223"; /* Set functions */ diff --git a/workbench/src/wb_project.c b/workbench/src/wb_project.c index 5411084ac..3e3aceea5 100644 --- a/workbench/src/wb_project.c +++ b/workbench/src/wb_project.c @@ -228,6 +228,9 @@ static GSList *wb_project_dir_get_file_list(WB_PROJECT_DIR *root, const gchar *u { GSList *list = NULL; GDir *dir; + const gchar *child_name; + GSList *child = NULL; + GSList *children = NULL; gchar *locale_path = utils_get_locale_from_utf8(utf8_path); gchar *real_path = utils_get_real_path(locale_path); @@ -245,14 +248,19 @@ static GSList *wb_project_dir_get_file_list(WB_PROJECT_DIR *root, const gchar *u g_hash_table_insert(visited_paths, real_path, GINT_TO_POINTER(1)); - while (TRUE) + while ((child_name = g_dir_read_name(dir)) != NULL) + { + children = g_slist_prepend(children, g_strdup(child_name)); + } + + g_dir_close(dir); + + foreach_slist(child, children) { const gchar *locale_name; gchar *locale_filename, *utf8_filename, *utf8_name; - locale_name = g_dir_read_name(dir); - if (!locale_name) - break; + locale_name = child->data; utf8_name = utils_get_utf8_from_locale(locale_name); locale_filename = g_build_filename(locale_path, locale_name, NULL); @@ -287,7 +295,7 @@ static GSList *wb_project_dir_get_file_list(WB_PROJECT_DIR *root, const gchar *u g_free(utf8_name); } - g_dir_close(dir); + g_slist_free_full(children, g_free); g_free(locale_path); return list;