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