Blame SOURCES/0203-commands-search-Fix-bug-stopping-iteration-when-no-f.patch

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