From 5693e1e7b0945bcafaa80d95efaf3ffc9e243835 Mon Sep 17 00:00:00 2001 From: RocketRobz Date: Mon, 15 Oct 2018 23:37:38 -0600 Subject: [PATCH] Pressing A on ".." if on drive root, will return to [root] menu --- arm9/source/file_browse.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/arm9/source/file_browse.cpp b/arm9/source/file_browse.cpp index 7160407..7b5e3be 100644 --- a/arm9/source/file_browse.cpp +++ b/arm9/source/file_browse.cpp @@ -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());