Finally fixed linux asset weirdness
This commit is contained in:
@@ -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!
|
||||
|
||||
Reference in New Issue
Block a user