Skip to content

Commit

Permalink
Change replace to substring
Browse files Browse the repository at this point in the history
  • Loading branch information
DieKautz committed Feb 7, 2024
1 parent 230be16 commit 65776c9
Showing 1 changed file with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,13 @@ public static Object loadLibrary(final SqueakImageContext context, final String
final String libName = System.mapLibraryName(moduleName);
TruffleFile libPath = context.getHomePath().resolve("lib" + File.separatorChar + libName);
if (!libPath.exists()) {
// to preserve compatibility with plugins from opensmalltalk, also check without 'lib'
// prefix
if (libName.startsWith("lib")) {
libPath = context.getHomePath().resolve("lib" + File.separatorChar + libName.replace("lib", ""));
if (!libPath.exists()) {
return null;
}
} else {
// to preserve compatibility with plugins from opensmalltalk
// also check without 'lib' prefix
if (!libName.startsWith("lib")) {
return null;
}
libPath = context.getHomePath().resolve("lib" + File.separatorChar + libName.substring(3));
if (!libPath.exists()) {
return null;
}
}
Expand Down

0 comments on commit 65776c9

Please sign in to comment.