diff options
Diffstat (limited to 'apps/plugins/multiboot_select.c')
-rw-r--r-- | apps/plugins/multiboot_select.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/apps/plugins/multiboot_select.c b/apps/plugins/multiboot_select.c index 993a47c0e4..2922136548 100644 --- a/apps/plugins/multiboot_select.c +++ b/apps/plugins/multiboot_select.c | |||
@@ -155,11 +155,20 @@ static int find_roots(void) | |||
155 | 155 | ||
156 | struct dirent* ent; | 156 | struct dirent* ent; |
157 | while((ent = rb->readdir(dir))) { | 157 | while((ent = rb->readdir(dir))) { |
158 | /* skip non-directories */ | ||
159 | if ((rb->dir_get_info(dir, ent).attribute & ATTR_DIRECTORY) == 0) { | ||
160 | continue; | ||
161 | } | ||
162 | |||
158 | const char *dname = ent->d_name; | 163 | const char *dname = ent->d_name; |
159 | if (*dname == '.' && *(dname + 1) == '\0') | 164 | /* check for bootdir in the root of the volume */ |
160 | dname++; /* skip the dot so we can check root of volume */ | 165 | if (rb->strcmp(bootdir, dname) == 0) { |
166 | dname = ""; | ||
167 | } | ||
168 | |||
161 | int r = rb->snprintf(tmpbuf, sizeof(tmpbuf), "/<%d>/%s/%s/%s", | 169 | int r = rb->snprintf(tmpbuf, sizeof(tmpbuf), "/<%d>/%s/%s/%s", |
162 | vol, dname, bootdir, BOOTFILE); | 170 | vol, dname, bootdir, BOOTFILE); |
171 | |||
163 | if(r < 0 || (size_t)r >= sizeof(tmpbuf)) | 172 | if(r < 0 || (size_t)r >= sizeof(tmpbuf)) |
164 | continue; | 173 | continue; |
165 | 174 | ||