Are those empty lines result of manual editing of envblk? You should not do
this

Regards

Le dim. 18 mai 2025, 11:01, Shreenidhi Shedi <[email protected]> a écrit :

> From: Shreenidhi Shedi <[email protected]>
>
> 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 <[email protected]>
> Reviewed-by: Alexey Makhalov  <[email protected]>
> ---
>  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
> [email protected]
> https://lists.gnu.org/mailman/listinfo/grub-devel
>
_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to