tint2conf: fix segfault in corner case
This commit is contained in:
parent
2f74250634
commit
c8ccf053ff
1 changed files with 9 additions and 3 deletions
|
@ -145,10 +145,16 @@ void theme_list_append(const gchar *path)
|
||||||
GtkTreeIter iter;
|
GtkTreeIter iter;
|
||||||
gtk_list_store_append(theme_list_store, &iter);
|
gtk_list_store_append(theme_list_store, &iter);
|
||||||
|
|
||||||
gchar *name = strrchr(path, '/') + 1;
|
gchar *name, *dir;
|
||||||
|
|
||||||
gchar *dir = g_strdup(path);
|
if (strchr(path, '/')) {
|
||||||
strrchr(dir, '/')[0] = 0;
|
name = strrchr(path, '/') + 1;
|
||||||
|
dir = g_strdup(path);
|
||||||
|
strrchr(dir, '/')[0] = 0;
|
||||||
|
} else {
|
||||||
|
name = (gchar*)path;
|
||||||
|
dir = g_strdup(".");
|
||||||
|
}
|
||||||
char *suffix = contract_tilde(dir);
|
char *suffix = contract_tilde(dir);
|
||||||
g_free(dir);
|
g_free(dir);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue