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

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