From db58686ea91f7276adbf68e9db40fba0a4112405 Mon Sep 17 00:00:00 2001 From: Nick White Date: Sun, 14 Jun 2009 19:42:51 +0100 Subject: Initial commit --- games-engines/gemrb/files/multiplecfgs.patch | 91 ++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 games-engines/gemrb/files/multiplecfgs.patch (limited to 'games-engines/gemrb/files/multiplecfgs.patch') diff --git a/games-engines/gemrb/files/multiplecfgs.patch b/games-engines/gemrb/files/multiplecfgs.patch new file mode 100644 index 0000000..7aa16be --- /dev/null +++ b/games-engines/gemrb/files/multiplecfgs.patch @@ -0,0 +1,91 @@ +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])) { -- cgit v1.2.3