From: Vladimir 'phcoder' Serbinenko Date: Wed, 18 Nov 2009 17:54:23 +0000 (+0100) Subject: Fixed bug which causes some commands to be masked X-Git-Tag: 1.98~210^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=024478a2d8fba8fc6d26f61480058fc64de353fc;p=thirdparty%2Fgrub.git Fixed bug which causes some commands to be masked --- diff --git a/normal/dyncmd.c b/normal/dyncmd.c index 6e5028906..edaf614b8 100644 --- a/normal/dyncmd.c +++ b/normal/dyncmd.c @@ -78,14 +78,22 @@ read_command_list (void) if (file) { char *buf = NULL; + grub_command_t ptr, last = 0, next; /* Override previous commands.lst. */ - while (grub_command_list) + for (ptr = grub_command_list; ptr; ptr = next) { - grub_command_t tmp; - tmp = grub_command_list->next; - grub_free (grub_command_list); - grub_command_list = tmp; + 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))