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