summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Mendoza-Jonas <sam@mendozajonas.com>2017-02-20 16:24:47 +1100
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>2017-03-15 16:29:57 +1100
commit63271b068064caea5f148f6bd6728adabef5cf87 (patch)
tree769e6112255cbaced31cb0ef187e392125bcb5f7
parentc7202ebe8fe98afb3e5b73bbdb78db652e8df5d1 (diff)
downloadpetitboot-63271b068064caea5f148f6bd6728adabef5cf87.zip
petitboot-63271b068064caea5f148f6bd6728adabef5cf87.tar.gz
ui/ncurses: Fix adding unnecessary leading slashes to paths
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
-rw-r--r--ui/ncurses/nc-boot-editor.c3
1 files changed, 2 insertions, 1 deletions
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);
OpenPOWER on IntegriCloud