* looking for smalltalk@sv.gnu.org/smalltalk--devo--2.2--patch-541 to compare with * comparing to smalltalk@sv.gnu.org/smalltalk--devo--2.2--patch-541 M lib-src/ltdl.c * modified files --- orig/lib-src/ltdl.c +++ mod/lib-src/ltdl.c @@ -3460,10 +3460,26 @@ /* If FILENAME already bears a suitable extension, there is no need to try appending additional extensions. */ if (ext) + { for (try_ext = all_lib_exts; *try_ext; try_ext += LT_STRLEN (try_ext) + 1) if (strcmp (ext, try_ext) == 0) return lt_dlopen (filename); +#ifdef LTDL_SHLIB_EXT + /* Try to find the next '.' to see if we could load by soname. */ + for (tmp = ext - 1; tmp >= filename; --tmp) + if (*tmp == '.') + { + if (strncmp (tmp, shlib_ext, sizeof(shlib_ext) - 1) == 0) + return lt_dlopen (filename); + else + break; + } + + tmp = 0; +#endif + } + /* First try appending ARCHIVE_EXT. */ for (first = 1, try_ext = all_lib_exts; *try_ext; first = 0) {