2009-12-21 Andreas Born <futur.andy@googlemail.com>

* kern/env.c (grub_env_export): Create nonexistent variables before
	exporting.
This commit is contained in:
Andreas Born 2009-12-21 15:20:12 +01:00 committed by Vladimir 'phcoder' Serbinenko
parent 7f39d92f8d
commit 0175d51f49
2 changed files with 16 additions and 3 deletions

View file

@ -1,5 +1,10 @@
2009-12-21 Andreas Born <futur.andy@googlemail.com>
* kern/env.c (grub_env_export): Create nonexistent variables before
exporting.
2009-12-20 Carles Pina i Estany <carles@pina.cat> 2009-12-20 Carles Pina i Estany <carles@pina.cat>
* include/grub/auth.h: Include `<grub/i18n.h>'. * include/grub/auth.h: Include `<grub/i18n.h>'.
(GRUB_GET_PASSWORD): Gettextizze string. (GRUB_GET_PASSWORD): Gettextizze string.
* include/grub/normal.h (STANDARD_MARGIN): New macro, moved from * include/grub/normal.h (STANDARD_MARGIN): New macro, moved from

View file

@ -170,8 +170,16 @@ grub_env_export (const char *name)
struct grub_env_var *var; struct grub_env_var *var;
var = grub_env_find (name); var = grub_env_find (name);
if (var) if (! var)
var->type = GRUB_ENV_VAR_GLOBAL; {
grub_err_t err;
err = grub_env_set (name, "");
if (err)
return err;
var = grub_env_find (name);
}
var->type = GRUB_ENV_VAR_GLOBAL;
return GRUB_ERR_NONE; return GRUB_ERR_NONE;
} }