* grub-core/fs/iso9660.c (grub_iso9660_iterate_dir): Skip . and ..

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2011-06-24 13:02:49 +02:00
parent 2a5e94d84a
commit 98e2f50661
2 changed files with 8 additions and 7 deletions

View file

@ -1,3 +1,7 @@
2011-06-24 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/fs/iso9660.c (grub_iso9660_iterate_dir): Skip . and ..
2011-06-24 Vladimir Serbinenko <phcoder@gmail.com> 2011-06-24 Vladimir Serbinenko <phcoder@gmail.com>
* util/grub-mkconfig_lib.in (prepare_grub_to_access_device): Load * util/grub-mkconfig_lib.in (prepare_grub_to_access_device): Load

View file

@ -598,7 +598,7 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir,
return 0; return 0;
} }
while (offset < dir->size) for (; offset < dir->size; offset += dirent.len)
{ {
if (grub_disk_read (dir->data->disk, if (grub_disk_read (dir->data->disk,
(dir->blk << GRUB_ISO9660_LOG2_BLKSZ) (dir->blk << GRUB_ISO9660_LOG2_BLKSZ)
@ -676,10 +676,9 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir,
if (filename) if (filename)
*filename = '\0'; *filename = '\0';
if (dirent.namelen == 1 && name[0] == 0) /* . and .. */
filename = "."; if (dirent.namelen == 1 && (name[0] == 0 || name[0] == 1))
else if (dirent.namelen == 1 && name[0] == 1) continue;
filename = "..";
else else
filename = name; filename = name;
} }
@ -712,8 +711,6 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir,
if (filename_alloc) if (filename_alloc)
grub_free (filename); grub_free (filename);
} }
offset += dirent.len;
} }
return 0; return 0;