From 2d76fa730386622f1f2774df615f661088dfe7c7 Mon Sep 17 00:00:00 2001 From: A1ive <10670106+a1ive@users.noreply.github.com> Date: Wed, 6 Apr 2022 20:09:45 +0800 Subject: [PATCH] fix bugs (#1561) * fix bug stopping iteration when --no-floppy is used * fix gfxmenu theme config handling bug --- GRUB2/MOD_SRC/grub-2.04/grub-core/commands/search.c | 2 +- GRUB2/MOD_SRC/grub-2.04/grub-core/gfxmenu/theme_loader.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/commands/search.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/commands/search.c index 3852c0c7..70d0fce2 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/commands/search.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/commands/search.c @@ -68,7 +68,7 @@ iterate_device (const char *name, void *data) /* Skip floppy drives when requested. */ if (ctx->no_floppy && name[0] == 'f' && name[1] == 'd' && name[2] >= '0' && name[2] <= '9') - return 1; + return 0; if (g_no_vtoyefi_part && (grub_strcmp(name, g_vtoyefi_dosname) == 0 || grub_strcmp(name, g_vtoyefi_gptname) == 0)) { return 0; diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/gfxmenu/theme_loader.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/gfxmenu/theme_loader.c index 7c3c883f..11707df4 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/gfxmenu/theme_loader.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/gfxmenu/theme_loader.c @@ -456,7 +456,8 @@ read_expression (struct parsebuf *p) /* Read as a single word -- for numeric values or words without whitespace. */ start = p->pos; - while (has_more (p) && ! is_whitespace (peek_char (p))) + while (has_more (p) && ! is_whitespace (peek_char (p)) + && peek_char (p) != '}') read_char (p); end = p->pos; }