[Win32] Only believe HOME if it is an absolute path and exists. (#138618)

2004-05-15  Tor Lillqvist  <tml@iki.fi>

	* glib/gutils.c (g_get_any_init): [Win32] Only believe HOME if it
	is an absolute path and exists. (#138618)
This commit is contained in:
Tor Lillqvist 2004-05-15 03:24:16 +00:00 committed by Tor Lillqvist
parent 267009b913
commit 38bb555ce3
6 changed files with 32 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2004-05-15 Tor Lillqvist <tml@iki.fi>
* glib/gutils.c (g_get_any_init): [Win32] Only believe HOME if it
is an absolute path and exists. (#138618)
2004-05-14 Tor Lillqvist <tml@iki.fi>
* glib/gnulib/vasnprintf.c (vasnprintf): Handle empty digit string

View File

@ -1,3 +1,8 @@
2004-05-15 Tor Lillqvist <tml@iki.fi>
* glib/gutils.c (g_get_any_init): [Win32] Only believe HOME if it
is an absolute path and exists. (#138618)
2004-05-14 Tor Lillqvist <tml@iki.fi>
* glib/gnulib/vasnprintf.c (vasnprintf): Handle empty digit string

View File

@ -1,3 +1,8 @@
2004-05-15 Tor Lillqvist <tml@iki.fi>
* glib/gutils.c (g_get_any_init): [Win32] Only believe HOME if it
is an absolute path and exists. (#138618)
2004-05-14 Tor Lillqvist <tml@iki.fi>
* glib/gnulib/vasnprintf.c (vasnprintf): Handle empty digit string

View File

@ -1,3 +1,8 @@
2004-05-15 Tor Lillqvist <tml@iki.fi>
* glib/gutils.c (g_get_any_init): [Win32] Only believe HOME if it
is an absolute path and exists. (#138618)
2004-05-14 Tor Lillqvist <tml@iki.fi>
* glib/gnulib/vasnprintf.c (vasnprintf): Handle empty digit string

View File

@ -1,3 +1,8 @@
2004-05-15 Tor Lillqvist <tml@iki.fi>
* glib/gutils.c (g_get_any_init): [Win32] Only believe HOME if it
is an absolute path and exists. (#138618)
2004-05-14 Tor Lillqvist <tml@iki.fi>
* glib/gnulib/vasnprintf.c (vasnprintf): Handle empty digit string

View File

@ -867,7 +867,13 @@ g_get_any_init (void)
/* We check $HOME first for Win32, though it is a last resort for Unix
* where we prefer the results of getpwuid().
*/
g_home_dir = g_strdup (g_getenv ("HOME"));
{
gchar *home = g_getenv ("HOME");
/* Only believe HOME if it is an absolute path and exists */
if (g_path_is_absolute (home) && g_file_test (home, G_FILE_TEST_IS_DIR))
g_home_dir = g_strdup (home);
}
/* In case HOME is Unix-style (it happens), convert it to
* Windows style.