]> git.ozlabs.org Git - petitboot/commit
In GRUB2 parser save_env, treat unset variable value as empty
authorAlan Dunn <amdunn@google.com>
Tue, 15 Mar 2016 00:40:47 +0000 (17:40 -0700)
committerSam Mendoza-Jonas <sam@mendozajonas.com>
Tue, 15 Mar 2016 03:10:00 +0000 (14:10 +1100)
commit6e5cd61065181460be8152a73dfc79f94ecd27fe
tree62a597293437291e9e495af53d5eaa1714dfcb60
parentc005b174aa484ecafdbd403af80ea7375b67bc31
In GRUB2 parser save_env, treat unset variable value as empty

It seems better to treat unset variable values as empty rather than
crashing in save_env.  While GRUB's behavior is actually to delete the
variable from the environment block, it seems useful to at least not
crash while later on someone can do further work to improve GRUB
compatibility if desired.

Tested:
 Modified test-grub2-save-env to cover this case.

Signed-off-by: Alan Dunn <amdunn@google.com>
Signed-off-by: Sam Mendoza-Jonas <sam@mendozajonas.com>
discover/grub2/env.c
test/parser/test-grub2-save-env.c