Pressing A on ".." if on drive root, will return to [root] menu

This commit is contained in:
RocketRobz 2018-10-15 23:37:38 -06:00
parent 2b6d19efd2
commit 5693e1e7b0

View File

@ -450,7 +450,13 @@ string browseForFile (void) {
if (pressed & KEY_A) {
DirEntry* entry = &dirContents.at(fileOffset);
if (entry->isDirectory) {
if (((strcmp (entry->name.c_str(), "..") == 0) && (strcmp (path, "sd:/") == 0))
|| ((strcmp (entry->name.c_str(), "..") == 0) && (strcmp (path, "fat:/") == 0))
|| ((strcmp (entry->name.c_str(), "..") == 0) && (strcmp (path, "nitro:/") == 0)))
{
screenMode = 0;
return "null";
} else if (entry->isDirectory) {
iprintf("Entering directory\n");
// Enter selected directory
chdir (entry->name.c_str());