From 63271b068064caea5f148f6bd6728adabef5cf87 Mon Sep 17 00:00:00 2001 From: Samuel Mendoza-Jonas Date: Mon, 20 Feb 2017 16:24:47 +1100 Subject: [PATCH 1/1] ui/ncurses: Fix adding unnecessary leading slashes to paths Signed-off-by: Samuel Mendoza-Jonas --- ui/ncurses/nc-boot-editor.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/ncurses/nc-boot-editor.c b/ui/ncurses/nc-boot-editor.c index 7fa1a42..8991095 100644 --- a/ui/ncurses/nc-boot-editor.c +++ b/ui/ncurses/nc-boot-editor.c @@ -162,7 +162,8 @@ static char *conditional_prefix(struct pb_boot_data *ctx, sep = ""; if (!prefix) prefix = ""; - else if (prefix[strlen(prefix)] != '/') + else if ((prefix[strlen(prefix) - 1] != '/') && + (value[0] != '/')) sep = "/"; return talloc_asprintf(ctx, "%s%s%s", prefix, sep, value); -- 2.39.2