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 <shreenidhi.shedi@broadcom.com>
Reviewed-by: Alexey Makhalov <alexey.makhalov@broadcom.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
Shreenidhi Shedi 2025-05-19 23:49:54 +05:30 committed by Daniel Kiper
parent 34bd00ee26
commit be303f8c18

View File

@ -235,7 +235,7 @@ grub_envblk_iterate (grub_envblk_t envblk,
while (p < pend) while (p < pend)
{ {
if (*p != '#') if (*p != '#' && *p != '\n' && *p != '\r')
{ {
char *name; char *name;
char *value; char *value;