1 Index: glib-2.18.3/docs/reference/glib/running.sgml
2 ===================================================================
3 --- glib-2.18.3.orig/docs/reference/glib/running.sgml 2008-11-26 12:01:53.559365436 +0100
4 +++ glib-2.18.3/docs/reference/glib/running.sgml 2008-11-26 12:25:58.155366255 +0100
5 @@ -194,6 +194,22 @@ variables like <envar>LANG</envar>, <env
9 +<formalpara id="G_HOME">
10 + <title><envar>G_HOME</envar></title>
13 + For various reasons, GLib applications ignore the <envar>HOME</envar>
14 + environment variable on Unix systems and will use the user directory
15 + as specified by the <filename>passwd</filename> entry, which is more
19 + The <envar>G_HOME</envar> environment variable will override any
20 + other setting for the home directory. It is not meant for daily usage,
21 + but it is useful in testing or building environments.
27 <refsect2 id="setlocale">
28 Index: glib-2.18.3/glib/gutils.c
29 ===================================================================
30 --- glib-2.18.3.orig/glib/gutils.c 2008-11-26 11:50:38.607861683 +0100
31 +++ glib-2.18.3/glib/gutils.c 2008-11-26 12:00:29.035360081 +0100
32 @@ -1520,11 +1520,14 @@ g_get_any_init_do (void)
34 #endif /* !G_OS_WIN32 */
36 + g_home_dir = g_strdup (g_getenv ("G_HOME"));
39 /* We check $HOME first for Win32, though it is a last resort for Unix
40 * where we prefer the results of getpwuid().
42 - g_home_dir = g_strdup (g_getenv ("HOME"));
44 + g_home_dir = g_strdup (g_getenv ("HOME"));
46 /* Only believe HOME if it is an absolute path and exists */
48 @@ -1820,6 +1823,11 @@ g_get_real_name (void)
49 * homedir = g_get_home_dir (<!-- -->);
52 + * However, to allow changing this value for testing and development
53 + * purposes, the value of the <envar>G_HOME</envar> environment
54 + * variable, if set, will override the <filename>passwd</filename>
57 * Returns: the current user's home directory