From 5eac5c72b8f4a1773771152f02ac724703ad68b6 Mon Sep 17 00:00:00 2001 From: lifehackerhansol Date: Mon, 14 Oct 2024 16:13:30 -0700 Subject: [PATCH] mainlist: sanity check going back from top menu When going back to the top directory, the code passes "...". But what if you go back *from* the top directory? In this case, the menu goes crazy and loads the SD card directory, and it is impossible to go back to the top directory. At the top directory, the location is not "..." but actually "". It is also possible for the directory passed to be ".../". Add a check for all these probabilities and treat them like the top directory. --- arm9/source/mainlist.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arm9/source/mainlist.cpp b/arm9/source/mainlist.cpp index bb6b957..ed35148 100644 --- a/arm9/source/mainlist.cpp +++ b/arm9/source/mainlist.cpp @@ -109,7 +109,7 @@ static bool extnameFilter(const std::vector& extNames, std::string bool cMainList::enterDir(const std::string& dirName) { _saves.clear(); - if ("..." == dirName) // select RPG or SD card + if (memcmp(dirName.c_str(), "...", 3) == 0 || dirName.empty()) // select RPG or SD card { removeAllRows(); _romInfoList.clear();