From: Shreenidhi Shedi <yesshedi@gmail.com>
To: grub-devel@gnu.org
Cc: yesshedi@gmail.com, alexey.makhalov@broadcom.com,
daniel.kiper@oracle.com,
Shreenidhi Shedi <shreenidhi.shedi@broadcom.com>
Subject: [PATCH v1 1/2] envblk: ignore empty new lines while parsing env files
Date: Sun, 18 May 2025 13:21:20 +0530 [thread overview]
Message-ID: <20250518075121.76584-2-yesshedi@gmail.com> (raw)
In-Reply-To: <20250518075121.76584-1-yesshedi@gmail.com>
From: Shreenidhi Shedi <shreenidhi.shedi@broadcom.com>
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 <shreenidhi.shedi@broadcom.com>
Reviewed-by: Alexey Makhalov <alexey.makhalov@broadcom.com>
---
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..f08dabaad 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')
{
char *name;
char *value;
--
2.49.0
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
next prev parent reply other threads:[~2025-05-18 8:00 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-18 7:51 [PATCH v1 0/2] Fix cfg file parsing and command line parsing Shreenidhi Shedi
2025-05-18 7:51 ` Shreenidhi Shedi [this message]
2025-05-19 17:13 ` [PATCH v1 1/2] envblk: ignore empty new lines while parsing env files Daniel Kiper
2025-05-19 17:25 ` Alexey Makhalov via Grub-devel
2025-05-19 18:20 ` Shreenidhi Shedi
2025-05-19 18:17 ` Vladimir 'phcoder' Serbinenko
2025-05-18 7:51 ` [PATCH v1 2/2] cmdline: fix command line parsing in grub Shreenidhi Shedi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250518075121.76584-2-yesshedi@gmail.com \
--to=yesshedi@gmail.com \
--cc=alexey.makhalov@broadcom.com \
--cc=daniel.kiper@oracle.com \
--cc=grub-devel@gnu.org \
--cc=shreenidhi.shedi@broadcom.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.