Fix *.lst handling after ${prefix} redefinition.
This commit is contained in:
parent
34f4a5b005
commit
e880248e79
4 changed files with 41 additions and 21 deletions
|
@ -62,12 +62,6 @@ void
|
|||
read_command_list (void)
|
||||
{
|
||||
const char *prefix;
|
||||
static int first_time = 1;
|
||||
|
||||
/* Make sure that this function does not get executed twice. */
|
||||
if (! first_time)
|
||||
return;
|
||||
first_time = 0;
|
||||
|
||||
prefix = grub_env_get ("prefix");
|
||||
if (prefix)
|
||||
|
@ -84,6 +78,16 @@ read_command_list (void)
|
|||
if (file)
|
||||
{
|
||||
char *buf = NULL;
|
||||
|
||||
/* Override previous commands.lst. */
|
||||
while (grub_command_list)
|
||||
{
|
||||
grub_command_t tmp;
|
||||
tmp = grub_command_list->next;
|
||||
grub_free (grub_command_list);
|
||||
grub_command_list = tmp;
|
||||
}
|
||||
|
||||
for (;; grub_free (buf))
|
||||
{
|
||||
char *p, *name, *modname;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue