From: Colin Watson Date: Sat, 26 Jun 2010 09:46:54 +0000 (+0100) Subject: Make the `source' command slightly faster. X-Git-Tag: 1.99~797 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3fa06487244de28f6d219be3bd8e040747aaa759;p=thirdparty%2Fgrub.git Make the `source' command slightly faster. * normal/main.c (grub_normal_execute): Don't re-read list files when nested. --- diff --git a/ChangeLog b/ChangeLog index b37f0eff7..52b37640f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2010-06-26 Colin Watson + + Make the `source' command slightly faster. + + * normal/main.c (grub_normal_execute): Don't re-read list files when + nested. + 2010-06-23 Colin Watson * loader/i386/multiboot_mbi.c (retrieve_video_parameters): Set red diff --git a/normal/main.c b/normal/main.c index fdd3c558c..7275b6367 100644 --- a/normal/main.c +++ b/normal/main.c @@ -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) {