e82a4fd
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
e82a4fd
From: =?UTF-8?q?Renaud=20M=C3=A9trich?= <rmetrich@redhat.com>
e82a4fd
Date: Tue, 8 Feb 2022 08:39:10 +0100
9a30e00
Subject: [PATCH] commands/search: Fix bug stopping iteration when --no-floppy
9a30e00
 is used
e82a4fd
MIME-Version: 1.0
e82a4fd
Content-Type: text/plain; charset=UTF-8
e82a4fd
Content-Transfer-Encoding: 8bit
e82a4fd
e82a4fd
When using --no-floppy and a floppy was encountered, iterate_device()
e82a4fd
was returning 1, causing the iteration to stop instead of continuing.
e82a4fd
e82a4fd
Signed-off-by: Renaud M├ętrich <rmetrich@redhat.com>
9a30e00
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
9a30e00
(cherry picked from commit 68ba54c2298604146be83cae144dafd1cfd1fe2d)
9a30e00
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
e82a4fd
---
e82a4fd
 grub-core/commands/search.c | 2 +-
e82a4fd
 1 file changed, 1 insertion(+), 1 deletion(-)
e82a4fd
e82a4fd
diff --git a/grub-core/commands/search.c b/grub-core/commands/search.c
e622855
index ed090b3af8..51656e361c 100644
e82a4fd
--- a/grub-core/commands/search.c
e82a4fd
+++ b/grub-core/commands/search.c
e82a4fd
@@ -64,7 +64,7 @@ iterate_device (const char *name, void *data)
e82a4fd
   /* Skip floppy drives when requested.  */
e82a4fd
   if (ctx->no_floppy &&
e82a4fd
       name[0] == 'f' && name[1] == 'd' && name[2] >= '0' && name[2] <= '9')
e82a4fd
-    return 1;
e82a4fd
+    return 0;
e82a4fd
 
e82a4fd
 #ifdef DO_SEARCH_FS_UUID
e82a4fd
 #define compare_fn grub_strcasecmp