commit 9708ce7d8fc820666d2447785b1c2359f533ed6f
Author: jtothebell <j.to.the.bell@gmail.com>
AuthorDate: Sat Nov 14 12:30:57 2020 -0700
Commit: jtothebell <j.to.the.bell@gmail.com>
CommitDate: Sat Nov 14 12:30:57 2020 -0700
fix loading carts in sdl2
---
platform/SDL2/source/SDL2Host.cpp | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/platform/SDL2/source/SDL2Host.cpp b/platform/SDL2/source/SDL2Host.cpp
index 7d11ec2..5a1b66a 100644
--- a/platform/SDL2/source/SDL2Host.cpp
+++ b/platform/SDL2/source/SDL2Host.cpp
@@ -333,10 +333,11 @@ vector<string> Host::listcarts(){
struct dirent *ent;
std::string home = getenv("HOME");
std::string cartDir = "/p8carts";
- if ((dir = opendir ((home + cartDir).c_str())) != NULL) {
+ std::string fullCartDir = home + cartDir;
+ if ((dir = opendir (fullCartDir.c_str())) != NULL) {
/* print all the files and directories within directory */
while ((ent = readdir (dir)) != NULL) {
- carts.push_back(ent->d_name);
+ carts.push_back(fullCartDir + "/" + ent->d_name);
}
closedir (dir);
} else {