[gnome-games] libgames-support: Add a way to specify the relocation root by env var
- From: Christian Persch <chpe src gnome org>
- To: svn-commits-list gnome org
- Subject: [gnome-games] libgames-support: Add a way to specify the relocation root by env var
- Date: Sun, 12 Jul 2009 19:21:12 +0000 (UTC)
commit eb2c00ed41ce8dcd1c1f07179f3952783792fd6d
Author: Christian Persch <chpe gnome org>
Date: Sun Jul 12 20:21:13 2009 +0200
libgames-support: Add a way to specify the relocation root by env var
When GAMES_RELOC_ROOT is set, use that as the relocation root.
libgames-support/games-runtime.c | 28 +++++++++++++++++-----------
1 files changed, 17 insertions(+), 11 deletions(-)
---
diff --git a/libgames-support/games-runtime.c b/libgames-support/games-runtime.c
index cb75234..cb3f7bc 100644
--- a/libgames-support/games-runtime.c
+++ b/libgames-support/games-runtime.c
@@ -494,21 +494,27 @@ games_runtime_get_directory (GamesRuntimeDirectory directory)
#else
{
GbrInitError errv = 0;
- char *exe, *bindir, *prefix;
+ const char *env;
- exe = _br_find_exe (&errv);
- if (exe == NULL) {
- g_printerr ("Failed to locate the binary relocation prefix (error code %u)\n", errv);
+ if ((env = g_getenv ("GAMES_RELOC_ROOT")) != NULL) {
+ path = g_strdup (env);
} else {
- bindir = g_path_get_dirname (exe);
- g_free (exe);
- prefix = g_path_get_dirname (bindir);
- g_free (bindir);
+ char *exe, *bindir, *prefix;
- if (prefix != NULL && strcmp (prefix, ".") != 0) {
- path = prefix;
+ exe = _br_find_exe (&errv);
+ if (exe == NULL) {
+ g_printerr ("Failed to locate the binary relocation prefix (error code %u)\n", errv);
} else {
- g_free (prefix);
+ bindir = g_path_get_dirname (exe);
+ g_free (exe);
+ prefix = g_path_get_dirname (bindir);
+ g_free (bindir);
+
+ if (prefix != NULL && strcmp (prefix, ".") != 0) {
+ path = prefix;
+ } else {
+ g_free (prefix);
+ }
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]