diff options
author | Nick White <git@njw.me.uk> | 2009-06-14 19:42:51 +0100 |
---|---|---|
committer | Nick White <git@njw.me.uk> | 2009-06-14 19:42:51 +0100 |
commit | db58686ea91f7276adbf68e9db40fba0a4112405 (patch) | |
tree | c1afdd244def5611db551bb25f9a319e7a2aa93b /games-engines/gemrb/files/multiplecfgs.patch | |
download | njw-gentoo-local-db58686ea91f7276adbf68e9db40fba0a4112405.tar.bz2 njw-gentoo-local-db58686ea91f7276adbf68e9db40fba0a4112405.zip |
Initial commit
Diffstat (limited to 'games-engines/gemrb/files/multiplecfgs.patch')
-rw-r--r-- | games-engines/gemrb/files/multiplecfgs.patch | 91 |
1 files changed, 91 insertions, 0 deletions
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 <filename>, 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 <filename>, 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 <filename>, load config from filename + if (argc > 2 && ! strcmp("-c", argv[1])) { |