Finally fixed linux asset weirdness

This commit is contained in:
2026-05-02 15:18:49 -05:00
parent ff77f8cfa0
commit 4a4adeb3c8
+6 -5
View File
@@ -40,10 +40,10 @@ 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);
}
// Open zip file
char_t searchPath[ASSET_FILE_PATH_MAX];
@@ -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!