Bugzilla: 53014
authorlarryh%netscape.com
Mon, 06 Nov 2000 23:33:07 +0000
changeset 1623 0df9f380f26228b17934c4b0d6e38ce76f6fd0cd
parent 1620 d4fe8fb52efb56eabe7b555fc21d2fc42171aab0
child 1625 67ddc1a88a9db5020487002bdb49605a364db96b
push idunknown
push userunknown
push dateunknown
bugs53014
Bugzilla: 53014
pr/src/linking/prlink.c
--- a/pr/src/linking/prlink.c
+++ b/pr/src/linking/prlink.c
@@ -840,21 +840,27 @@ pr_LoadLibraryByPathname(const char *nam
 			/* the stub was loaded successfully.  however, the stub
 			   itself is useless (so useless, in fact, that we will
 			   simply unload it) */
 			unload_add_on(h);
 			h = B_FILE_NOT_FOUND;
 
 			cookie = 0;
 			while (get_next_image_info(0, &cookie, &info) == B_OK) {
-				char *endOfName = info.name + strlen(info.name) - strlen(name);
-				if (endOfName < info.name)
-					continue;
-
-				if (strcmp(name, endOfName) == 0) {
+				char *endOfSystemName = strrchr(info.name, '/');
+				char *endOfPassedName = strrchr(name, '/');
+				if( 0 == endOfSystemName ) 
+					endOfSystemName=info.name;
+				else
+					endOfSystemName++;
+				if( 0 == endOfPassedName )
+					endOfPassedName=name;
+				else
+					endOfPassedName++;
+				if (strcmp(endOfSystemName, endOfPassedName) == 0) {
 					/* this is the actual component - remember it */
 					h = info.id;
 					break;
 				}
 			}
 
 		} else {
 			/* we failed to load the "stub" - try to load the