]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
commands/search: Fix bug stopping iteration when --no-floppy is used
authorRenaud Métrich <rmetrich@redhat.com>
Tue, 8 Feb 2022 07:39:10 +0000 (08:39 +0100)
committerDaniel Kiper <daniel.kiper@oracle.com>
Mon, 7 Mar 2022 13:21:06 +0000 (14:21 +0100)
When using --no-floppy and a floppy was encountered, iterate_device()
was returning 1, causing the iteration to stop instead of continuing.

Signed-off-by: Renaud Métrich <rmetrich@redhat.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/commands/search.c

index ed090b3af8b20c62b41d4fd9116affe701cc45d6..51656e361cc04e5afe392635df21febc48cb52ea 100644 (file)
@@ -64,7 +64,7 @@ iterate_device (const char *name, void *data)
   /* Skip floppy drives when requested.  */
   if (ctx->no_floppy &&
       name[0] == 'f' && name[1] == 'd' && name[2] >= '0' && name[2] <= '9')
-    return 1;
+    return 0;
 
 #ifdef DO_SEARCH_FS_UUID
 #define compare_fn grub_strcasecmp