On 19/05/25 22:43, Daniel Kiper wrote:
On Sun, May 18, 2025 at 01:21:20PM +0530, Shreenidhi Shedi wrote:
From: Shreenidhi Shedi <shreenidhi.sh...@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.sh...@broadcom.com>
Reviewed-by: Alexey Makhalov  <alexey.makha...@broadcom.com>

Please do not add RBs if reviews have not been done in public.
Those given on the grub-devel counts only.

---
  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')

Why do not add '\r' too?

Daniel

On suggestion regarding RBs, will keep it in mind going forward.

I will add check to ignore '\r' and send v2 shortly.

Thanks for the review.

--
Shedi

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to