Make the `source' command slightly faster.

* normal/main.c (grub_normal_execute): Don't re-read list files when
nested.
This commit is contained in:
Colin Watson 2010-06-26 10:46:54 +01:00
parent e9b29642bd
commit 3fa0648724
2 changed files with 15 additions and 4 deletions

View file

@ -464,11 +464,15 @@ void
grub_normal_execute (const char *config, int nested, int batch)
{
grub_menu_t menu = 0;
const char *prefix = grub_env_get ("prefix");
const char *prefix;
read_lists (prefix);
grub_register_variable_hook ("prefix", NULL, read_lists_hook);
grub_command_execute ("parser.grub", 0, 0);
if (! nested)
{
prefix = grub_env_get ("prefix");
read_lists (prefix);
grub_register_variable_hook ("prefix", NULL, read_lists_hook);
grub_command_execute ("parser.grub", 0, 0);
}
if (config)
{