mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-07-30 13:53:30 +02:00
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.
This commit is contained in:
@@ -411,30 +411,32 @@ 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 (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 NATIVE_WIN32
|
||||
if (!g_home_dir)
|
||||
{
|
||||
/* 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 */
|
||||
|
||||
#ifdef HAVE_PWD_H
|
||||
{
|
||||
|
Reference in New Issue
Block a user