--- OgreMain/src/OgreDynLib.cpp.orig 2013-04-20 05:28:11.276661686 -0500
+++ OgreMain/src/OgreDynLib.cpp 2013-04-20 06:08:16.392339521 -0500
@@ -71,7 +71,9 @@
String name = mName;
#if OGRE_PLATFORM == OGRE_PLATFORM_LINUX || OGRE_PLATFORM == OGRE_PLATFORM_NACL
// dlopen() does not add .so to the filename, like windows does for .dll
- if (name.find(".so") == String::npos)
+ mInst = (DYNLIB_HANDLE)DYNLIB_LOAD( name.c_str() );
+ // Only add .so if open without it failed
+ if ((!mInst) && (name.find(".so") == String::npos))
name += ".so";
#elif OGRE_PLATFORM == OGRE_PLATFORM_APPLE
// dlopen() does not add .dylib to the filename, like windows does for .dll
@@ -83,7 +85,7 @@
if (name.substr(name.length() - 4, 4) != ".dll")
name += ".dll";
#endif
- mInst = (DYNLIB_HANDLE)DYNLIB_LOAD( name.c_str() );
+ if ( !mInst ) mInst = (DYNLIB_HANDLE)DYNLIB_LOAD( name.c_str() );
if( !mInst )
OGRE_EXCEPT(