From d22dd4fb3cf918b6d329fb878292b3caaad96eee Mon Sep 17 00:00:00 2001 From: Brennen Murphy Date: Thu, 14 Nov 2024 17:42:53 -0500 Subject: [PATCH] Prevent ICON0 in browser setting from crashing within File Browswer ( CL ) --- extras/menus/arkMenu/src/browser.cpp | 4 ++-- extras/menus/arkMenu/src/browser_entries.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/extras/menus/arkMenu/src/browser.cpp b/extras/menus/arkMenu/src/browser.cpp index 14a2db12..cbf14585 100644 --- a/extras/menus/arkMenu/src/browser.cpp +++ b/extras/menus/arkMenu/src/browser.cpp @@ -642,8 +642,8 @@ void Browser::drawScreen(){ common::printText(xoffset, yoffset, e->getName().c_str(), LITEGRAY, SIZE_BIG, focused, (focused)? &scroll : NULL, 0); if (common::getConf()->browser_icon0){ Image* icon = e->getIcon(); - if (icon){ - icon->draw(320, 21); + if (icon && e->getName().c_str()[0] != '.'){ // Prevent ../ from displaying ICON0 + icon->draw(320, 21); } } } diff --git a/extras/menus/arkMenu/src/browser_entries.cpp b/extras/menus/arkMenu/src/browser_entries.cpp index b8cabbd3..67591faa 100644 --- a/extras/menus/arkMenu/src/browser_entries.cpp +++ b/extras/menus/arkMenu/src/browser_entries.cpp @@ -38,7 +38,7 @@ BrowserFile::BrowserFile(string path, string shortname){ size_t lastSlash = path.rfind('/', string::npos); this->path = path; this->name = path.substr(lastSlash+1, string::npos); - this->parent = path.substr(0, lastSlash) + '/'; + this->parent = path.substr(0, lastSlash); this->icon0 = NULL; this->selected = false; this->filetype = FOLDER; @@ -158,7 +158,7 @@ BrowserFolder::BrowserFolder(string path, string shortname){ this->selected = false; this->fileSize = "Folder"; this->filetype = FOLDER; - if (shortname.size() > 0) shortname += '/'; + if (shortname.size() > 0) shortname; this->setShortName(shortname); } @@ -170,7 +170,7 @@ BrowserFolder::BrowserFolder(string parent, string name, string shortname){ this->selected = false; this->fileSize = "Folder"; this->filetype = FOLDER; - if (shortname.size() > 0) shortname += '/'; + if (shortname.size() > 0) shortname; this->setShortName(shortname); }