From 40d31060d8df49705a835432847be6bcd25a2ff6 Mon Sep 17 00:00:00 2001 From: gunnar_g Date: Wed, 10 Dec 2008 13:41:27 +0000 Subject: [PATCH] The leading slash is removed. Instead of "" the first element is now a correct directoryname --- src/treeview.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/treeview.c b/src/treeview.c index 5a80c84f..bac54077 100644 --- a/src/treeview.c +++ b/src/treeview.c @@ -2649,13 +2649,21 @@ treeview_create_country_list(const GPtrArray *country_list) gboolean create_new_line; // This variable will be used to lookup gchar* previous_element; + gchar* current_country; for(i=0;ilen;i++) { // We get countries as /<...>/ // We then try to build a tree using "/ or \" as a separator // The list is already sorted, so we don't need to verify - dir_split_up = g_strsplit_set ((gchar*)g_ptr_array_index(country_list, i), "\\/", -1); + current_country = g_strdup((gchar*)g_ptr_array_index(country_list, i)); + if (g_str_has_prefix(current_country,"/")||g_str_has_prefix(current_country,"\\")) + { + // Strip leading "\\" + sprintf(buf, "%.*s", strlen(current_country) - 1, ¤t_country[1]); + current_country = g_strdup(buf); + } + dir_split_up = g_strsplit_set (current_country, "\\/", -1); for (j=0; j