diff options
Diffstat (limited to 'apps/plugins')
| -rw-r--r-- | apps/plugins/random_folder_advance_config.c | 11 |
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 f459aa0..7f6018d 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) bool check = false; int i; - rb->snprintf(fullpath, sizeof(fullpath), "%s/%s", location, name); - dir = rb->opendir(fullpath); + /* behave differently if we're at root to avoid + duplication of the initial slash later on */ + if (location[0] == '\0' && name[0] == '\0') { + rb->strcpy(fullpath, ""); + dir = rb->opendir("/"); + } else { + rb->snprintf(fullpath, sizeof(fullpath), "%s/%s", location, name); + dir = rb->opendir(fullpath); + } if (dir) { entry = rb->readdir(dir); while (entry) { |