nalika / rpms / grub2

Forked from rpms/grub2 2 years ago
Clone

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

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