]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Make the `source' command slightly faster.
authorColin Watson <cjwatson@ubuntu.com>
Sat, 26 Jun 2010 09:46:54 +0000 (10:46 +0100)
committerColin Watson <cjwatson@ubuntu.com>
Sat, 26 Jun 2010 09:46:54 +0000 (10:46 +0100)
* normal/main.c (grub_normal_execute): Don't re-read list files when
nested.

ChangeLog
normal/main.c

index b37f0eff7c14d945dcaa108b37e4fae2d86067f8..52b37640f2bf5633e7a9287b3963bde750d1380c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-06-26  Colin Watson  <cjwatson@ubuntu.com>
+
+       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  <cjwatson@ubuntu.com>
 
        * loader/i386/multiboot_mbi.c (retrieve_video_parameters): Set red
index fdd3c558cd589315524c7220ed3b73b254c2051a..7275b636787619eceec3ae9dfd463e65215e0bc7 100644 (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)
     {