diff --git a/kern/fs.c b/kern/fs.c index 0c45637..0154db4 100644 --- a/kern/fs.c +++ b/kern/fs.c @@ -65,12 +65,14 @@ grub_fs_t grub_fs_probe (grub_device_t device) { grub_fs_t p; + int found_file; auto int dummy_func (const char *filename, const struct grub_dirhook_info *info); int dummy_func (const char *filename __attribute__ ((unused)), const struct grub_dirhook_info *info __attribute__ ((unused))) { + found_file = 1; return 1; } @@ -82,8 +84,10 @@ grub_fs_probe (grub_device_t device) for (p = grub_fs_list; p; p = p->next) { grub_dprintf ("fs", "Detecting %s...\n", p->name); + + found_file = 0; (p->dir) (device, "/", dummy_func); - if (grub_errno == GRUB_ERR_NONE) + if (grub_errno == GRUB_ERR_NONE && file_found)) return p; grub_error_push ();