merge mainline into asprintf

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2010-01-20 07:36:17 +01:00
commit 2d49abe9e7
342 changed files with 14569 additions and 4699 deletions

View file

@ -63,12 +63,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,24 @@ read_command_list (void)
if (file)
{
char *buf = NULL;
grub_command_t ptr, last = 0, next;
/* Override previous commands.lst. */
for (ptr = grub_command_list; ptr; ptr = next)
{
next = ptr->next;
if (ptr->func == grub_dyncmd_dispatcher)
{
if (last)
last->next = ptr->next;
else
grub_command_list = ptr->next;
grub_free (ptr);
}
else
last = ptr;
}
for (;; grub_free (buf))
{
char *p, *name, *modname;