Fix *.lst handling after ${prefix} redefinition.

This commit is contained in:
Robert Millan 2009-11-09 14:55:27 +00:00
parent 34f4a5b005
commit e880248e79
4 changed files with 41 additions and 21 deletions

View file

@ -135,7 +135,6 @@ void
read_handler_list (void)
{
const char *prefix;
static int first_time = 1;
const char *class_name;
auto int iterate_handler (grub_handler_t handler);
@ -162,11 +161,6 @@ read_handler_list (void)
return 0;
}
/* Make sure that this function does not get executed twice. */
if (! first_time)
return;
first_time = 0;
prefix = grub_env_get ("prefix");
if (prefix)
{
@ -182,6 +176,16 @@ read_handler_list (void)
if (file)
{
char *buf = NULL;
/* Override previous handler.lst. */
while (grub_handler_class_list)
{
grub_handler_class_t tmp;
tmp = grub_handler_class_list->next;
grub_free (grub_handler_class_list);
grub_handler_class_list = tmp;
}
for (;; grub_free (buf))
{
char *p;