From cb7d9f6769fa51cd09230eda98cf984ea636c826 Mon Sep 17 00:00:00 2001 From: Anthony Green Date: Wed, 22 Aug 2001 23:10:07 +0000 Subject: [PATCH] Look for lib-gnu-pkg-quux.so, not gnu-pkg-quux.so. From-SVN: r45115 --- libjava/ChangeLog | 5 +++++ libjava/java/lang/natClassLoader.cc | 12 +++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/libjava/ChangeLog b/libjava/ChangeLog index b5f0dee882b..f7092d18951 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,8 @@ +2001-08-21 Anthony Green + + * java/lang/natClassLoader.cc (findClass): Search for + lib-gnu-pkg-quux.so, not gnu-pkg-quux.so. + 2001-08-21 Jeff Sturm * java/util/IdentityHashMap.java (get): Fix off-by-one error. diff --git a/libjava/java/lang/natClassLoader.cc b/libjava/java/lang/natClassLoader.cc index 81e2206b114..0a82ee9c84d 100644 --- a/libjava/java/lang/natClassLoader.cc +++ b/libjava/java/lang/natClassLoader.cc @@ -35,6 +35,7 @@ details. */ #include #include #include +#include #include #include @@ -184,11 +185,12 @@ gnu::gcj::runtime::VMClassLoader::findClass (jstring name) if (! klass) { - // Turn `gnu.pkg.quux' into `gnu-pkg-quux'. Then search for a - // module named (eg, on Linux) `gnu-pkg-quux.so', followed by - // `gnu-pkg.so' and `gnu.so'. If loading one of these causes - // the class to appear in the cache, then use it. - jstring so_base_name = name->replace ('.', '-'); + // Turn `gnu.pkg.quux' into `lib-gnu-pkg-quux'. Then search for + // a module named (eg, on Linux) `lib-gnu-pkg-quux.so', followed + // by `lib-gnu-pkg.so' and `lib-gnu.so'. If loading one of + // these causes the class to appear in the cache, then use it. + java::lang::StringBuffer *sb = new java::lang::StringBuffer (JvNewStringLatin1("lib-")); + jstring so_base_name = (sb->append (name)->toString ())->replace ('.', '-'); while (! klass && so_base_name && so_base_name->length() > 0) { -- 2.30.2