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:
parent
34bd00ee26
commit
be303f8c18
@ -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;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user