Where we have getpwuid[_r], use that in preference to $HOME, and only

Tue Mar  5 00:38:54 2002  Owen Taylor  <otaylor@redhat.com>

        * glib/gutils.c (g_get_any_init): Where we have
        getpwuid[_r], use that in preference to $HOME, and
        only check $HOME as a fallback if getpwuid fails.
        (#2311)
This commit is contained in:
Owen Taylor 2002-03-05 05:46:08 +00:00 committed by Owen Taylor
parent fc8fd6f8cb
commit d39eabea71
9 changed files with 65 additions and 4 deletions

View File

@ -1,3 +1,10 @@
Tue Mar 5 00:38:54 2002 Owen Taylor <otaylor@redhat.com>
* glib/gutils.c (g_get_any_init): Where we have
getpwuid[_r], use that in preference to $HOME, and
only check $HOME as a fallback if getpwuid fails.
(#2311)
Sun Mar 3 21:09:24 2002 Owen Taylor <otaylor@redhat.com> Sun Mar 3 21:09:24 2002 Owen Taylor <otaylor@redhat.com>
* configure.in: Default to --disable-gtk-doc, to avoid * configure.in: Default to --disable-gtk-doc, to avoid

View File

@ -1,3 +1,10 @@
Tue Mar 5 00:38:54 2002 Owen Taylor <otaylor@redhat.com>
* glib/gutils.c (g_get_any_init): Where we have
getpwuid[_r], use that in preference to $HOME, and
only check $HOME as a fallback if getpwuid fails.
(#2311)
Sun Mar 3 21:09:24 2002 Owen Taylor <otaylor@redhat.com> Sun Mar 3 21:09:24 2002 Owen Taylor <otaylor@redhat.com>
* configure.in: Default to --disable-gtk-doc, to avoid * configure.in: Default to --disable-gtk-doc, to avoid

View File

@ -1,3 +1,10 @@
Tue Mar 5 00:38:54 2002 Owen Taylor <otaylor@redhat.com>
* glib/gutils.c (g_get_any_init): Where we have
getpwuid[_r], use that in preference to $HOME, and
only check $HOME as a fallback if getpwuid fails.
(#2311)
Sun Mar 3 21:09:24 2002 Owen Taylor <otaylor@redhat.com> Sun Mar 3 21:09:24 2002 Owen Taylor <otaylor@redhat.com>
* configure.in: Default to --disable-gtk-doc, to avoid * configure.in: Default to --disable-gtk-doc, to avoid

View File

@ -1,3 +1,10 @@
Tue Mar 5 00:38:54 2002 Owen Taylor <otaylor@redhat.com>
* glib/gutils.c (g_get_any_init): Where we have
getpwuid[_r], use that in preference to $HOME, and
only check $HOME as a fallback if getpwuid fails.
(#2311)
Sun Mar 3 21:09:24 2002 Owen Taylor <otaylor@redhat.com> Sun Mar 3 21:09:24 2002 Owen Taylor <otaylor@redhat.com>
* configure.in: Default to --disable-gtk-doc, to avoid * configure.in: Default to --disable-gtk-doc, to avoid

View File

@ -1,3 +1,10 @@
Tue Mar 5 00:38:54 2002 Owen Taylor <otaylor@redhat.com>
* glib/gutils.c (g_get_any_init): Where we have
getpwuid[_r], use that in preference to $HOME, and
only check $HOME as a fallback if getpwuid fails.
(#2311)
Sun Mar 3 21:09:24 2002 Owen Taylor <otaylor@redhat.com> Sun Mar 3 21:09:24 2002 Owen Taylor <otaylor@redhat.com>
* configure.in: Default to --disable-gtk-doc, to avoid * configure.in: Default to --disable-gtk-doc, to avoid

View File

@ -1,3 +1,10 @@
Tue Mar 5 00:38:54 2002 Owen Taylor <otaylor@redhat.com>
* glib/gutils.c (g_get_any_init): Where we have
getpwuid[_r], use that in preference to $HOME, and
only check $HOME as a fallback if getpwuid fails.
(#2311)
Sun Mar 3 21:09:24 2002 Owen Taylor <otaylor@redhat.com> Sun Mar 3 21:09:24 2002 Owen Taylor <otaylor@redhat.com>
* configure.in: Default to --disable-gtk-doc, to avoid * configure.in: Default to --disable-gtk-doc, to avoid

View File

@ -1,3 +1,10 @@
Tue Mar 5 00:38:54 2002 Owen Taylor <otaylor@redhat.com>
* glib/gutils.c (g_get_any_init): Where we have
getpwuid[_r], use that in preference to $HOME, and
only check $HOME as a fallback if getpwuid fails.
(#2311)
Sun Mar 3 21:09:24 2002 Owen Taylor <otaylor@redhat.com> Sun Mar 3 21:09:24 2002 Owen Taylor <otaylor@redhat.com>
* configure.in: Default to --disable-gtk-doc, to avoid * configure.in: Default to --disable-gtk-doc, to avoid

View File

@ -1,3 +1,10 @@
Tue Mar 5 00:38:54 2002 Owen Taylor <otaylor@redhat.com>
* glib/gutils.c (g_get_any_init): Where we have
getpwuid[_r], use that in preference to $HOME, and
only check $HOME as a fallback if getpwuid fails.
(#2311)
Sun Mar 3 21:09:24 2002 Owen Taylor <otaylor@redhat.com> Sun Mar 3 21:09:24 2002 Owen Taylor <otaylor@redhat.com>
* configure.in: Default to --disable-gtk-doc, to avoid * configure.in: Default to --disable-gtk-doc, to avoid

View File

@ -744,10 +744,12 @@ g_get_any_init (void)
#endif /* G_OS_WIN32 */ #endif /* G_OS_WIN32 */
} }
if (!g_home_dir) #ifdef G_OS_WIN32
/* 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")); g_home_dir = g_strdup (g_getenv ("HOME"));
#ifdef G_OS_WIN32
/* In case HOME is Unix-style (it happens), convert it to /* In case HOME is Unix-style (it happens), convert it to
* Windows style. * Windows style.
*/ */
@ -882,6 +884,9 @@ g_get_any_init (void)
#endif /* !HAVE_PWD_H */ #endif /* !HAVE_PWD_H */
if (!g_home_dir)
g_home_dir = g_strdup (g_getenv ("HOME"));
#ifdef __EMX__ #ifdef __EMX__
/* change '\\' in %HOME% to '/' */ /* change '\\' in %HOME% to '/' */
g_strdelimit (g_home_dir, "\\",'/'); g_strdelimit (g_home_dir, "\\",'/');