From 31c600b753d265c775fdac92dc54631d097993a3 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 2 Oct 2015 06:19:43 +0200 Subject: [PATCH] (Zarch) If last character is a slash, strip it - this will prevent 'path up' from failing --- menu/drivers/zarch.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/menu/drivers/zarch.c b/menu/drivers/zarch.c index 40f93e057e..5ece2698bb 100644 --- a/menu/drivers/zarch.c +++ b/menu/drivers/zarch.c @@ -549,7 +549,15 @@ void render_lay_root(zui_t *zui) unsigned cwd_offset; if (!zui->load_cwd) + { zui->load_cwd = strdup(zui->set->menu_content_directory); + if ((zui->load_cwd[strlen(zui->load_cwd)-1] == '/') +#ifdef _WIN32 + || (zui->load_cwd[strlen(zui->load_cwd)-1] == '\\') +#endif + ) + zui->load_cwd[strlen(zui->load_cwd)-1] = 0; + } if (!zui->load_dlist) { @@ -580,7 +588,11 @@ void render_lay_root(zui_t *zui) if (zui_list_item(zui, 0, tabbed.tabline_size + 40, "^ ..")) { path_basedir(zui->load_cwd); - if (zui->load_cwd[strlen(zui->load_cwd)-1] == '/') + if ((zui->load_cwd[strlen(zui->load_cwd)-1] == '/') +#ifdef _WIN32 + || (zui->load_cwd[strlen(zui->load_cwd)-1] == '\\') +#endif + ) zui->load_cwd[strlen(zui->load_cwd)-1] = 0; dir_list_free(zui->load_dlist);