480730 dlopen on MAC OS X ignores provided path forgot #4 in review r=wan-teh NSPR_HEAD_20090321
authorglen.beasley%sun.com
Fri, 20 Mar 2009 06:49:37 +0000
changeset 4080 0a9a1926b32d3686a509eb5c4b58198fa0556b4f
parent 4079 ce17f1660d6b2562d4af05f043907795890956e9
child 4081 2d36a1b5e90fe869fa6fc550b33814a3744754fd
push idunknown
push userunknown
push dateunknown
reviewerswan-teh
bugs480730
480730 dlopen on MAC OS X ignores provided path forgot #4 in review r=wan-teh
pr/src/linking/prlink.c
--- a/pr/src/linking/prlink.c
+++ b/pr/src/linking/prlink.c
@@ -889,24 +889,20 @@ pr_LoadLibraryByPathname(const char *nam
     }
     if (flags & PR_LD_LOCAL) {
         dl_flags |= RTLD_LOCAL;
     }
 #if defined(DARWIN)
     /* ensure the file exists if it contains a slash character i.e. path */
     /* DARWIN's dlopen ignores the provided path and checks for the */
     /* plain filename in DYLD_LIBRARY_PATH */
-    if (strchr(name, PR_DIRECTORY_SEPARATOR) != NULL) {
-        if (PR_Access(name, PR_ACCESS_EXISTS) == PR_SUCCESS) {
+    if (strchr(name, PR_DIRECTORY_SEPARATOR) == NULL ||
+        PR_Access(name, PR_ACCESS_EXISTS) == PR_SUCCESS) {
             h = dlopen(name, dl_flags);
         }
-    } else { 
-        /* search for name in the library path */
-        h = dlopen(name, dl_flags);
-    }
 #else
     h = dlopen(name, dl_flags);
 #endif
 #elif defined(USE_HPSHL)
     int shl_flags = 0;
     shl_t h;
 
     /*