From edebfc34bde3814e0704b504a0b0d79853250351 Mon Sep 17 00:00:00 2001 From: Arzhan Kinzhalin Date: Mon, 7 Aug 2017 17:05:29 +0000 Subject: [PATCH] Clean up. --- src/bootloaders/shim-systemd.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/bootloaders/shim-systemd.c b/src/bootloaders/shim-systemd.c index 1a91237..5dcb794 100644 --- a/src/bootloaders/shim-systemd.c +++ b/src/bootloaders/shim-systemd.c @@ -25,7 +25,8 @@ * * /EFI/ * Boot/ - * BOOTX64.EFI <-- whatever was there before + * BOOTX64.EFI <-- this implementation never modifies the + * default fallback loader * * /org.clearlinux/ * bootloaderx64.efi <-- shim @@ -162,7 +163,7 @@ static bool shim_systemd_install(const BootManager *manager) { static bool shim_systemd_update(const BootManager *manager) { fprintf(stderr, "Call %s\n", __func__); - return true; + return shim_systemd_install(manager); } static bool shim_systemd_remove(const BootManager *manager) { @@ -177,7 +178,7 @@ static bool shim_systemd_init(const BootManager *manager) { prefix = strdup(boot_manager_get_prefix((BootManager *)manager)); len = strlen(prefix); - if (prefix[len-1] == '/') prefix[len-1] = '\0'; + if (len > 0 && prefix[len-1] == '/') prefix[len-1] = '\0'; shim_src = string_printf("%s/%s", prefix, SHIM_SRC); systemd_src = string_printf("%s/%s", prefix, SYSTEMD_SRC);