]> git.proxmox.com Git - grub2.git/commitdiff
Fix handling of install lists.
authorVladimir Serbinenko <phcoder@gmail.com>
Mon, 18 Nov 2013 10:38:00 +0000 (11:38 +0100)
committerVladimir Serbinenko <phcoder@gmail.com>
Mon, 18 Nov 2013 10:38:00 +0000 (11:38 +0100)
ChangeLog
util/grub-install-common.c

index 8f4de761a1a54369bb27bdd4c01e41e7b36411a5..8e286bf76f7cb303caa62bf579f5644c32a20abc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2013-11-18  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       Fix handling of install lists.
+
 2013-11-18  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * grub-core/lib/sparc64/setjmp.S: Force spilling of current window.
index d29da380d8e7dbcc36a3e1d37ddc3dfead0b129d..bdb81a72d082d331d01d5601786ad0416472b335 100644 (file)
@@ -271,6 +271,7 @@ handle_install_list (struct install_list *il, const char *val,
     }
   il->n_alloc = il->n_entries + 1;
   il->entries = xmalloc (il->n_alloc * sizeof (il->entries[0]));
+  ptr = val;
   for (ce = il->entries; ; ce++)
     {
       const char *bptr;
@@ -284,7 +285,6 @@ handle_install_list (struct install_list *il, const char *val,
       *ce = xmalloc (ptr - bptr + 1);
       memcpy (*ce, bptr, ptr - bptr);
       (*ce)[ptr - bptr] = '\0';
-      ce++;
     }
   *ce = NULL;
 }
@@ -662,10 +662,17 @@ grub_install_copy_files (const char *src,
                                                  install_modules.entries);
       for (p = path_list; p; p = p->next)
        {
-         char *srcf = grub_util_path_concat_ext (2, src, p->name, ".mo");
-         char *dstf = grub_util_path_concat_ext (2, dst, p->name, ".mo");
+         const char *srcf = p->name;
+         const char *dir;
+         char *dstf;
+
+         dir = grub_strrchr (srcf, '/');
+         if (dir)
+           dir++;
+         else
+           dir = srcf;
+         dstf = grub_util_path_concat (2, dst, dir);
          grub_install_compress_file (srcf, dstf, 1);
-         free (srcf);
          free (dstf);
        }
     }