Index: gemrb/plugins/Core/Interface.cpp =================================================================== --- gemrb/plugins/Core/Interface.cpp (revision 5876) +++ gemrb/plugins/Core/Interface.cpp (working copy) @@ -1813,59 +1813,51 @@ //if (!name[0]) // FIXME: could this happen? // strcpy (name, PACKAGE); // ugly hack - // If we were called as $0 -c , load config from filename - if (argc > 2 && ! strcmp("-c", argv[1])) { - if (LoadConfig( argv[2] )) { - return true; - } else { - // Explicitly specified cfg file HAS to be present - return false; - } - } - // FIXME: temporary hack, to be deleted?? if (LoadConfig( "GemRB.cfg" )) { return true; } - PathJoin( path, UserDir, name, NULL ); - strcat( path, ".cfg" ); - - if (LoadConfig( path )) { - return true; - } - + // Read gemrb.cfg #ifdef SYSCONFDIR - PathJoin( path, SYSCONFDIR, name, NULL ); + PathJoin( path, SYSCONFDIR, PACKAGE, NULL ); strcat( path, ".cfg" ); - if (LoadConfig( path )) { - return true; - } + LoadConfig( path ); #endif - // Don't try with default binary name if we have tried it already - if (!strcmp( name, PACKAGE )) { - return false; - } - PathJoin( path, UserDir, PACKAGE, NULL ); strcat( path, ".cfg" ); - if (LoadConfig( path )) { - return true; - } + LoadConfig( path ); + // Read binary name config + // Don't try with default binary name if we have tried it already + if (strcmp( name, PACKAGE )) { #ifdef SYSCONFDIR - PathJoin( path, SYSCONFDIR, PACKAGE, NULL ); - strcat( path, ".cfg" ); + PathJoin( path, SYSCONFDIR, name, NULL ); + strcat( path, ".cfg" ); - if (LoadConfig( path )) { - return true; - } + LoadConfig( path ); #endif - return false; + PathJoin( path, UserDir, name, NULL ); + strcat( path, ".cfg" ); + LoadConfig( path ); + } + + // If we were called as $0 -c , load config from filename + if (argc > 2 && ! strcmp("-c", argv[1])) { + if (LoadConfig( argv[2] )) { + return true; + } else { + // Explicitly specified cfg file HAS to be present + return false; + } + } + + return true; + #else // WIN32 // If we were called as $0 -c , load config from filename if (argc > 2 && ! strcmp("-c", argv[1])) {