summaryrefslogtreecommitdiff
path: root/gutils.c
diff options
context:
space:
mode:
authorTor Lillqvist <tml@src.gnome.org>1999-02-02 01:24:34 +0000
committerTor Lillqvist <tml@src.gnome.org>1999-02-02 01:24:34 +0000
commit0221263645002c662415b59283ba79b1830ef20f (patch)
tree6ad7ced4e06a9e21a23f491b37f896b3ab988d76 /gutils.c
parentf26256fe182bc1249d3058d9f18402d0ac26974c (diff)
downloadglib-0221263645002c662415b59283ba79b1830ef20f.tar.gz
Don't call ensure_stdout_valid (which would open an unneeded console
* gmessages.c (g_log_default_handler): (Win32:) Don't call ensure_stdout_valid (which would open an unneeded console window) if we're calling a logging function. Define ensure_stdout_valid as an empty macro on Unix. * gutils.c (g_get_any_init): (Win32:) Trust HOME first if defined, then try HOMEDRIVE and HOMEPATH.
Diffstat (limited to 'gutils.c')
-rw-r--r--gutils.c42
1 files changed, 22 insertions, 20 deletions
diff --git a/gutils.c b/gutils.c
index 50e7c361c..321a1311f 100644
--- a/gutils.c
+++ b/gutils.c
@@ -411,31 +411,33 @@ g_get_any_init (void)
#endif /* NATIVE_WIN32 */
}
-#ifdef NATIVE_WIN32
- /* The official way to specify a home directory on NT is
- * the HOMEDRIVE and HOMEPATH environment variables.
- *
- * This is inside #ifdef NATIVE_WIN32 because with the cygwin dll,
- * HOME should be a POSIX style pathname.
- */
+ if (!g_home_dir)
+ g_home_dir = g_strdup (g_getenv ("HOME"));
- if (getenv ("HOMEDRIVE") != NULL && getenv ("HOMEPATH") != NULL)
+#ifdef NATIVE_WIN32
+ if (!g_home_dir)
{
- gchar *homedrive, *homepath;
-
- homedrive = g_strdup (g_getenv ("HOMEDRIVE"));
- homepath = g_strdup (g_getenv ("HOMEPATH"));
-
- g_home_dir = g_strconcat (homedrive, homepath, NULL);
- g_free (homedrive);
- g_free (homepath);
+ /* The official way to specify a home directory on NT is
+ * the HOMEDRIVE and HOMEPATH environment variables.
+ *
+ * This is inside #ifdef NATIVE_WIN32 because with the cygwin dll,
+ * HOME should be a POSIX style pathname.
+ */
+
+ if (getenv ("HOMEDRIVE") != NULL && getenv ("HOMEPATH") != NULL)
+ {
+ gchar *homedrive, *homepath;
+
+ homedrive = g_strdup (g_getenv ("HOMEDRIVE"));
+ homepath = g_strdup (g_getenv ("HOMEPATH"));
+
+ g_home_dir = g_strconcat (homedrive, homepath, NULL);
+ g_free (homedrive);
+ g_free (homepath);
+ }
}
#endif /* !NATIVE_WIN32 */
- if (!g_home_dir)
- g_home_dir = g_strdup (g_getenv ("HOME"));
-
-
#ifdef HAVE_PWD_H
{
struct passwd *pw = NULL;