Here you go: ChangeLog: 2009-10-15 Andreas Born * kern/env.c (grub_env_export): Create nonexistent variables before exporting. The mixed indentation (tabs and spaces) in kern/env.c was a bit confusing. Andreas Colin Watson schrieb: > On Thu, Oct 15, 2009 at 08:40:37PM +0200, Andreas Born wrote: > >> This patch changes grub_env_export to create variables with empty value, >> if necessary. >> This makes it possible to export variables before actually assigning >> them any value and is the way bash behaves. >> > > This makes sense to me (although bash is "too big and too slow" and > we'll never implement anything close to all of it, this is a pretty > cheap way to reduce confusion due to differences), although probably for > post-1.97. A couple of nits: > > >> * kern/env.c (grub_env_export): Create inexistent variables >> before exporting. >> > > "nonexistent" > > >> + if (! var) >> + { >> + if (grub_env_set (name, "") != GRUB_ERR_NONE) >> + return grub_errno; >> + var = grub_env_find (name); >> + } >> > > GNU brace style involves indenting the braces as well, thus: > > if (! var) > { > if (grub_env_set (name, "") != GRUB_ERR_NONE) > return grub_errno; > var = grub_env_find (name); > } > >