summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/plugins/multiboot_select.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/apps/plugins/multiboot_select.c b/apps/plugins/multiboot_select.c
index 63babbb2c1..993a47c0e4 100644
--- a/apps/plugins/multiboot_select.c
+++ b/apps/plugins/multiboot_select.c
@@ -155,14 +155,17 @@ 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 const char *dname = ent->d_name;
159 if (*dname == '.' && *(dname + 1) == '\0')
160 dname++; /* skip the dot so we can check root of volume */
158 int r = rb->snprintf(tmpbuf, sizeof(tmpbuf), "/<%d>/%s/%s/%s", 161 int r = rb->snprintf(tmpbuf, sizeof(tmpbuf), "/<%d>/%s/%s/%s",
159 vol, ent->d_name, bootdir, BOOTFILE); 162 vol, dname, bootdir, BOOTFILE);
160 if(r < 0 || (size_t)r >= sizeof(tmpbuf)) 163 if(r < 0 || (size_t)r >= sizeof(tmpbuf))
161 continue; 164 continue;
162 165
163 if(check_firmware(tmpbuf)) { 166 if(check_firmware(tmpbuf)) {
164 rb->snprintf(roots[nroots], MAX_PATH, "/<%d>/%s", 167 rb->snprintf(roots[nroots], MAX_PATH, "/<%d>/%s",
165 vol, ent->d_name); 168 vol, dname);
166 nroots += 1; 169 nroots += 1;
167 170
168 /* quit if we hit the maximum */ 171 /* quit if we hit the maximum */