From a284320e1e0e44773960b76b9e0ce23c5ea362b5 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Mon, 18 Nov 2013 11:38:00 +0100 Subject: [PATCH] Fix handling of install lists. --- ChangeLog | 4 ++++ util/grub-install-common.c | 15 +++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8f4de761a..8e286bf76 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2013-11-18 Vladimir Serbinenko + + Fix handling of install lists. + 2013-11-18 Vladimir Serbinenko * grub-core/lib/sparc64/setjmp.S: Force spilling of current window. diff --git a/util/grub-install-common.c b/util/grub-install-common.c index d29da380d..bdb81a72d 100644 --- a/util/grub-install-common.c +++ b/util/grub-install-common.c @@ -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); } } -- 2.39.5