From 4a4adeb3c84cfb037eef0f3f74bae6167c477012 Mon Sep 17 00:00:00 2001 From: Dominic Masters Date: Sat, 2 May 2026 15:18:49 -0500 Subject: [PATCH] Finally fixed linux asset weirdness --- src/dusklinux/asset/assetlinux.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/dusklinux/asset/assetlinux.c b/src/dusklinux/asset/assetlinux.c index f93ad1d8..30b3ae3c 100644 --- a/src/dusklinux/asset/assetlinux.c +++ b/src/dusklinux/asset/assetlinux.c @@ -40,11 +40,11 @@ errorret_t assetInitLinux(void) { // We found the directory, set as system path stringCopy(ASSET.platform.systemPath, buffer, ASSET_FILE_PATH_MAX); } + } else { + // Default system path, intended to be overridden by the platform + stringCopy(ASSET.platform.systemPath, ".", ASSET_FILE_PATH_MAX); } - // Default system path, intended to be overridden by the platform - stringCopy(ASSET.platform.systemPath, ".", ASSET_FILE_PATH_MAX); - // Open zip file char_t searchPath[ASSET_FILE_PATH_MAX]; const char_t **path = ASSET_LINUX_SEARCH_PATHS; @@ -57,6 +57,7 @@ errorret_t assetInitLinux(void) { *path, ASSET_FILE_NAME ); + // Ensure combined length does not exceed ASSET_FILE_PATH_MAX size_t syslen = strlen(ASSET.platform.systemPath); size_t slashlen = 1; // for '/' @@ -71,13 +72,13 @@ errorret_t assetInitLinux(void) { ASSET.platform.systemPath, temp ); + printf("Try open asset file: %s\n", searchPath); // Try open + error = 0; ASSET.zip = zip_open(searchPath, ZIP_RDONLY, &error); - if(ASSET.zip == NULL) continue; - if(error != 0) { + if(ASSET.zip == NULL) { printf("Opened asset file with non-zero error code: %d\n", error); - ASSET.zip = NULL; continue; } break;// Found!