summaryrefslogtreecommitdiff
path: root/apps/gui/folder_select.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui/folder_select.c')
-rw-r--r--apps/gui/folder_select.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/apps/gui/folder_select.c b/apps/gui/folder_select.c
index 05354c4c6c..f2830fb8fd 100644
--- a/apps/gui/folder_select.c
+++ b/apps/gui/folder_select.c
@@ -103,9 +103,13 @@ static char* get_full_path(struct folder *start)
103{ 103{
104 static char buffer[MAX_PATH]; 104 static char buffer[MAX_PATH];
105 105
106 buffer[0] = '\0'; 106 if (strcmp(start->name, "/"))
107 107 {
108 get_full_path_r(start, buffer); 108 buffer[0] = 0;
109 get_full_path_r(start, buffer);
110 }
111 else /* get_full_path_r() does the wrong thing for / */
112 return "/";
109 113
110 return buffer; 114 return buffer;
111} 115}
@@ -447,8 +451,12 @@ static void save_folders_r(struct folder *root, char* dst, size_t maxlen)
447 snprintf(buffer_front, buffer_end - buffer_front, 451 snprintf(buffer_front, buffer_end - buffer_front,
448 "%s:", get_full_path(this->folder)); 452 "%s:", get_full_path(this->folder));
449 else 453 else
454 {
455 char *p = get_full_path(root);
450 snprintf(buffer_front, buffer_end - buffer_front, 456 snprintf(buffer_front, buffer_end - buffer_front,
451 "%s/%s:", get_full_path(root), this->name); 457 "%s/%s:", strcmp(p, "/") ? p : "",
458 strcmp(this->name, "/") ? this->name : "");
459 }
452 strlcat(dst, buffer_front, maxlen); 460 strlcat(dst, buffer_front, maxlen);
453 } 461 }
454 else if (this->state == EXPANDED) 462 else if (this->state == EXPANDED)