Hi
im working with cext recently on Linux and faced this problem.
Say we want to link a ruby app with 'awesome.so' witch has the init
method 'init_awesome'.
But if the 'awesome.so' is actually a symbolic link 'awesome.so.1',
ModuleLoader.java ends up calling 'init_awesome.so' method that does
not exist.
following change will fix this.
diff --git a/src/org/jruby/cext/ModuleLoader.java
b/src/org/jruby/cext/ModuleLoader.java
index 73c3e24..941ebf2 100644
--- a/src/org/jruby/cext/ModuleLoader.java
+++ b/src/org/jruby/cext/ModuleLoader.java
@@ -58,7 +58,7 @@ public class ModuleLoader {
String fileName = new File(name).getName();
String initName = fileName;
int dotPos;
- if ((dotPos = fileName.lastIndexOf('.')) != -1) {
+ if ((dotPos = fileName.indexOf('.')) != -1) {
// Remove the extension, if needed
initName = fileName.substring(0, dotPos);
}
Obakestar
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email