aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/fs/download.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/fs/download.c')
-rw-r--r--src/plugins/fs/download.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/plugins/fs/download.c b/src/plugins/fs/download.c
index 461b10b7..3a36d4ed 100644
--- a/src/plugins/fs/download.c
+++ b/src/plugins/fs/download.c
@@ -240,11 +240,16 @@ static void initiateDownload(GtkTreeModel * model,
240 dirTreePath = gtk_tree_path_copy(path); 240 dirTreePath = gtk_tree_path_copy(path);
241 dirPath = MALLOC(1); 241 dirPath = MALLOC(1);
242 dirPathLen = 0; 242 dirPathLen = 0;
243 while (gtk_tree_path_up(dirTreePath)) { 243 while (gtk_tree_path_get_depth(dirTreePath) > 1) {
244 const char *dirname; 244 const char *dirname;
245 char *new; 245 char *new;
246 246
247 if (!gtk_tree_model_get_iter(model, &iiter, dirTreePath)) 247 if (! gtk_tree_path_up(dirTreePath))
248 break;
249
250 if (!gtk_tree_model_get_iter(model,
251 &iiter,
252 dirTreePath))
248 break; 253 break;
249 gtk_tree_model_get(model, 254 gtk_tree_model_get(model,
250 &iiter, 255 &iiter,
@@ -258,7 +263,7 @@ static void initiateDownload(GtkTreeModel * model,
258 FREE(dirPath); 263 FREE(dirPath);
259 dirPath = new; 264 dirPath = new;
260 } 265 }
261 g_object_unref(dirTreePath); 266 gtk_tree_path_free(dirTreePath);
262 267
263 list->filename = pfx; 268 list->filename = pfx;
264 head = list; 269 head = list;