# Stops PhysFS from trying to get the base directory and user directory because it fails on Emscripten and on game consoles. Instead, we use sane defaults. --- a/src/physfs.c +++ b/src/physfs.c @@ -1226,10 +1226,10 @@ int PHYSFS_init(const char *argv0) if (!initializeMutexes()) goto initFailed; - baseDir = calculateBaseDir(argv0); + baseDir = "/"; if (!baseDir) goto initFailed; - userDir = __PHYSFS_platformCalcUserDir(); + userDir = "/"; if (!userDir) goto initFailed; /* Platform layer is required to append a dirsep. */ @@ -1367,13 +1367,11 @@ static int doDeinit(void) if (baseDir != NULL) { - allocator.Free(baseDir); baseDir = NULL; } /* if */ if (userDir != NULL) { - allocator.Free(userDir); userDir = NULL; } /* if */ --- a/src/physfs_platform_posix.c +++ b/src/physfs_platform_posix.c @@ -109,8 +109,8 @@ char *__PHYSFS_platformCalcUserDir(void) } /* if */ } /* if */ - if (retval == NULL) - retval = getUserDirByUID(); + + return retval; } /* __PHYSFS_platformCalcUserDir */ --- a/src/physfs_platform_unix.c +++ b/src/physfs_platform_unix.c @@ -227,7 +227,7 @@ static char *readSymLink(const char *path) break; /* out of memory. */ retval = ptr; - rc = readlink(path, retval, len); + rc = -1; if (rc == -1) break; /* not a symlink, i/o error, etc. */