From be303f8c1859b17e0dbee88cb7c8490058c150f4 Mon Sep 17 00:00:00 2001 From: Shreenidhi Shedi Date: Mon, 19 May 2025 23:49:54 +0530 Subject: [PATCH] lib/envblk: Ignore empty new lines while parsing env files Environment files may contain empty lines, which should be ignored during parsing. Currently, these lines are not skipped and resulting in incorrect behavior. This patch adds a check to skip empty lines along with those starting with "#". Signed-off-by: Shreenidhi Shedi Reviewed-by: Alexey Makhalov Reviewed-by: Daniel Kiper --- grub-core/lib/envblk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/lib/envblk.c b/grub-core/lib/envblk.c index 2e4e78b13..4862de50d 100644 --- a/grub-core/lib/envblk.c +++ b/grub-core/lib/envblk.c @@ -235,7 +235,7 @@ grub_envblk_iterate (grub_envblk_t envblk, while (p < pend) { - if (*p != '#') + if (*p != '#' && *p != '\n' && *p != '\r') { char *name; char *value; -- 2.47.3