1
0
Эх сурвалжийг харах

unix: OS-specific paths should also chop filename off base path.

Ryan C. Gordon 8 жил өмнө
parent
commit
a681fe258d
1 өөрчлөгдсөн 1 нэмэгдсэн , 4 устгасан
  1. 1 4
      src/platform_unix.c

+ 1 - 4
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");