nalika / rpms / grub2

Forked from rpms/grub2 2 years ago
Clone

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

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