foxygit / fake-08-xbox360 Log in
commit d081fea0e415d9983b13840aaa46272037b84a2b
Author:     Jon Bell <j.to.the.bell@gmail.com>
AuthorDate: Tue Dec 30 11:58:15 2025 -0700
Commit:     Jon Bell <j.to.the.bell@gmail.com>
CommitDate: Tue Dec 30 11:58:15 2025 -0700

    fix "no such file or directory"
---
 test/cartloadingtest.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/test/cartloadingtest.cpp b/test/cartloadingtest.cpp
index 05595bc..ededa6f 100644
--- a/test/cartloadingtest.cpp
+++ b/test/cartloadingtest.cpp
@@ -586,7 +586,7 @@ TEST_CASE("Loading and running carts") {

     DIR *dir;
     struct dirent *ent;
-    if ((dir = opendir (_cartDirectory.c_str())) != NULL) {
+    if (!_cartDirectory.empty() && (dir = opendir (_cartDirectory.c_str())) != NULL) {
         /* print all the files and directories within directory */
         while ((ent = readdir (dir)) != NULL) {
             if (isCartFile(ent->d_name)
@@ -596,9 +596,9 @@ TEST_CASE("Loading and running carts") {
             }
         }
         closedir (dir);
-    } else {
+    } else if (!_cartDirectory.empty()) {
         /* could not open directory */
-        perror ("");
+        perror ("Cart directory");
     }
     sort(carts.begin(), carts.end());