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.
This commit is contained in:
lifehackerhansol 2024-10-14 16:13:30 -07:00
parent 794685e291
commit 5eac5c72b8
No known key found for this signature in database
GPG Key ID: 80FB184AFC0B3B0E

View File

@ -109,7 +109,7 @@ static bool extnameFilter(const std::vector<std::string>& extNames, std::string
bool cMainList::enterDir(const std::string& dirName) { bool cMainList::enterDir(const std::string& dirName) {
_saves.clear(); _saves.clear();
if ("..." == dirName) // select RPG or SD card if (memcmp(dirName.c_str(), "...", 3) == 0 || dirName.empty()) // select RPG or SD card
{ {
removeAllRows(); removeAllRows();
_romInfoList.clear(); _romInfoList.clear();