From a681fe258de2cdb710a79dcd4fb52ad08426e34a Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Wed, 12 Jul 2017 20:52:51 -0400 Subject: [PATCH] unix: OS-specific paths should also chop filename off base path. --- src/platform_unix.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/platform_unix.c b/src/platform_unix.c index aa76a0f..80fd7a5 100644 --- a/src/platform_unix.c +++ b/src/platform_unix.c @@ -271,14 +271,11 @@ char *__PHYSFS_platformCalcBaseDir(const char *argv0) } #endif - if (retval) - return retval; /* already got it. */ - /* If there's a Linux-like /proc filesystem, you can get the full path to * the current process from a symlink in there. */ - if (access("/proc", F_OK) == 0) + if (!retval && (access("/proc", F_OK) == 0)) { retval = readSymLink("/proc/self/exe"); if (!retval) retval = readSymLink("/proc/curproc/file");