summaryrefslogtreecommitdiff
path: root/apps/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins')
-rw-r--r--apps/plugins/random_folder_advance_config.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/apps/plugins/random_folder_advance_config.c b/apps/plugins/random_folder_advance_config.c
index f459aa0776..7f6018df4e 100644
--- a/apps/plugins/random_folder_advance_config.c
+++ b/apps/plugins/random_folder_advance_config.c
@@ -65,8 +65,15 @@ static void traversedir(char* location, char* name)
65 bool check = false; 65 bool check = false;
66 int i; 66 int i;
67 67
68 rb->snprintf(fullpath, sizeof(fullpath), "%s/%s", location, name); 68 /* behave differently if we're at root to avoid
69 dir = rb->opendir(fullpath); 69 duplication of the initial slash later on */
70 if (location[0] == '\0' && name[0] == '\0') {
71 rb->strcpy(fullpath, "");
72 dir = rb->opendir("/");
73 } else {
74 rb->snprintf(fullpath, sizeof(fullpath), "%s/%s", location, name);
75 dir = rb->opendir(fullpath);
76 }
70 if (dir) { 77 if (dir) {
71 entry = rb->readdir(dir); 78 entry = rb->readdir(dir);
72 while (entry) { 79 while (entry) {