mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-20 07:38:54 +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:
10
ChangeLog
10
ChangeLog
@@ -1,3 +1,13 @@
|
|||||||
|
Tue Feb 02 00:08:54 1999 Tor Lillqvist <tml@iki.fi>
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
|
||||||
Mon Feb 1 19:04:28 1999 Owen Taylor <otaylor@redhat.com>
|
Mon Feb 1 19:04:28 1999 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* gmain.c (g_main_iterate): Release the main_loop
|
* gmain.c (g_main_iterate): Release the main_loop
|
||||||
|
@@ -1,3 +1,13 @@
|
|||||||
|
Tue Feb 02 00:08:54 1999 Tor Lillqvist <tml@iki.fi>
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
|
||||||
Mon Feb 1 19:04:28 1999 Owen Taylor <otaylor@redhat.com>
|
Mon Feb 1 19:04:28 1999 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* gmain.c (g_main_iterate): Release the main_loop
|
* gmain.c (g_main_iterate): Release the main_loop
|
||||||
|
@@ -1,3 +1,13 @@
|
|||||||
|
Tue Feb 02 00:08:54 1999 Tor Lillqvist <tml@iki.fi>
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
|
||||||
Mon Feb 1 19:04:28 1999 Owen Taylor <otaylor@redhat.com>
|
Mon Feb 1 19:04:28 1999 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* gmain.c (g_main_iterate): Release the main_loop
|
* gmain.c (g_main_iterate): Release the main_loop
|
||||||
|
@@ -1,3 +1,13 @@
|
|||||||
|
Tue Feb 02 00:08:54 1999 Tor Lillqvist <tml@iki.fi>
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
|
||||||
Mon Feb 1 19:04:28 1999 Owen Taylor <otaylor@redhat.com>
|
Mon Feb 1 19:04:28 1999 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* gmain.c (g_main_iterate): Release the main_loop
|
* gmain.c (g_main_iterate): Release the main_loop
|
||||||
|
@@ -1,3 +1,13 @@
|
|||||||
|
Tue Feb 02 00:08:54 1999 Tor Lillqvist <tml@iki.fi>
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
|
||||||
Mon Feb 1 19:04:28 1999 Owen Taylor <otaylor@redhat.com>
|
Mon Feb 1 19:04:28 1999 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* gmain.c (g_main_iterate): Release the main_loop
|
* gmain.c (g_main_iterate): Release the main_loop
|
||||||
|
@@ -1,3 +1,13 @@
|
|||||||
|
Tue Feb 02 00:08:54 1999 Tor Lillqvist <tml@iki.fi>
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
|
||||||
Mon Feb 1 19:04:28 1999 Owen Taylor <otaylor@redhat.com>
|
Mon Feb 1 19:04:28 1999 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* gmain.c (g_main_iterate): Release the main_loop
|
* gmain.c (g_main_iterate): Release the main_loop
|
||||||
|
@@ -1,3 +1,13 @@
|
|||||||
|
Tue Feb 02 00:08:54 1999 Tor Lillqvist <tml@iki.fi>
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
|
||||||
Mon Feb 1 19:04:28 1999 Owen Taylor <otaylor@redhat.com>
|
Mon Feb 1 19:04:28 1999 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* gmain.c (g_main_iterate): Release the main_loop
|
* gmain.c (g_main_iterate): Release the main_loop
|
||||||
|
@@ -1,3 +1,13 @@
|
|||||||
|
Tue Feb 02 00:08:54 1999 Tor Lillqvist <tml@iki.fi>
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
|
||||||
Mon Feb 1 19:04:28 1999 Owen Taylor <otaylor@redhat.com>
|
Mon Feb 1 19:04:28 1999 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* gmain.c (g_main_iterate): Release the main_loop
|
* gmain.c (g_main_iterate): Release the main_loop
|
||||||
|
@@ -50,12 +50,10 @@ write (FILE *fd,
|
|||||||
|
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
#endif /* NATIVE_WIN32 */
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ensure_stdout_valid (void)
|
ensure_stdout_valid (void)
|
||||||
{
|
{
|
||||||
#ifdef NATIVE_WIN32
|
|
||||||
HANDLE handle;
|
HANDLE handle;
|
||||||
|
|
||||||
handle = GetStdHandle (STD_OUTPUT_HANDLE);
|
handle = GetStdHandle (STD_OUTPUT_HANDLE);
|
||||||
@@ -65,8 +63,10 @@ ensure_stdout_valid (void)
|
|||||||
AllocConsole ();
|
AllocConsole ();
|
||||||
freopen ("CONOUT$", "w", stdout);
|
freopen ("CONOUT$", "w", stdout);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
#define ensure_stdout_valid() /* Define as empty */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* --- structures --- */
|
/* --- structures --- */
|
||||||
@@ -429,7 +429,6 @@ g_log_default_handler (const gchar *log_domain,
|
|||||||
* DOS prompt.
|
* DOS prompt.
|
||||||
*/
|
*/
|
||||||
fd = stdout;
|
fd = stdout;
|
||||||
ensure_stdout_valid ();
|
|
||||||
#else
|
#else
|
||||||
fd = (log_level >= G_LOG_LEVEL_MESSAGE) ? 1 : 2;
|
fd = (log_level >= G_LOG_LEVEL_MESSAGE) ? 1 : 2;
|
||||||
#endif
|
#endif
|
||||||
@@ -450,6 +449,7 @@ g_log_default_handler (const gchar *log_domain,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/* use write(2) for output, in case we are out of memeory */
|
/* use write(2) for output, in case we are out of memeory */
|
||||||
|
ensure_stdout_valid ();
|
||||||
if (log_domain)
|
if (log_domain)
|
||||||
{
|
{
|
||||||
write (fd, "\n", 1);
|
write (fd, "\n", 1);
|
||||||
@@ -469,6 +469,7 @@ g_log_default_handler (const gchar *log_domain,
|
|||||||
write (fd, "\n", 1);
|
write (fd, "\n", 1);
|
||||||
break;
|
break;
|
||||||
case G_LOG_LEVEL_CRITICAL:
|
case G_LOG_LEVEL_CRITICAL:
|
||||||
|
ensure_stdout_valid ();
|
||||||
if (log_domain)
|
if (log_domain)
|
||||||
{
|
{
|
||||||
write (fd, "\n", 1);
|
write (fd, "\n", 1);
|
||||||
@@ -494,6 +495,7 @@ g_log_default_handler (const gchar *log_domain,
|
|||||||
local_glib_warning_func (message);
|
local_glib_warning_func (message);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
ensure_stdout_valid ();
|
||||||
if (log_domain)
|
if (log_domain)
|
||||||
{
|
{
|
||||||
write (fd, "\n", 1);
|
write (fd, "\n", 1);
|
||||||
@@ -519,6 +521,7 @@ g_log_default_handler (const gchar *log_domain,
|
|||||||
local_glib_message_func (message);
|
local_glib_message_func (message);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
ensure_stdout_valid ();
|
||||||
if (log_domain)
|
if (log_domain)
|
||||||
{
|
{
|
||||||
write (fd, log_domain, strlen (log_domain));
|
write (fd, log_domain, strlen (log_domain));
|
||||||
@@ -535,6 +538,7 @@ g_log_default_handler (const gchar *log_domain,
|
|||||||
write (fd, "\n", 1);
|
write (fd, "\n", 1);
|
||||||
break;
|
break;
|
||||||
case G_LOG_LEVEL_INFO:
|
case G_LOG_LEVEL_INFO:
|
||||||
|
ensure_stdout_valid ();
|
||||||
if (log_domain)
|
if (log_domain)
|
||||||
{
|
{
|
||||||
write (fd, log_domain, strlen (log_domain));
|
write (fd, log_domain, strlen (log_domain));
|
||||||
@@ -551,6 +555,7 @@ g_log_default_handler (const gchar *log_domain,
|
|||||||
write (fd, "\n", 1);
|
write (fd, "\n", 1);
|
||||||
break;
|
break;
|
||||||
case G_LOG_LEVEL_DEBUG:
|
case G_LOG_LEVEL_DEBUG:
|
||||||
|
ensure_stdout_valid ();
|
||||||
if (log_domain)
|
if (log_domain)
|
||||||
{
|
{
|
||||||
write (fd, log_domain, strlen (log_domain));
|
write (fd, log_domain, strlen (log_domain));
|
||||||
@@ -570,6 +575,7 @@ g_log_default_handler (const gchar *log_domain,
|
|||||||
/* we are used for a log level that is not defined by GLib itself,
|
/* we are used for a log level that is not defined by GLib itself,
|
||||||
* try to make the best out of it.
|
* try to make the best out of it.
|
||||||
*/
|
*/
|
||||||
|
ensure_stdout_valid ();
|
||||||
if (log_domain)
|
if (log_domain)
|
||||||
{
|
{
|
||||||
write (fd, log_domain, strlen (log_domain));
|
write (fd, log_domain, strlen (log_domain));
|
||||||
|
@@ -411,30 +411,32 @@ g_get_any_init (void)
|
|||||||
#endif /* NATIVE_WIN32 */
|
#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)
|
if (!g_home_dir)
|
||||||
g_home_dir = g_strdup (g_getenv ("HOME"));
|
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
|
#ifdef HAVE_PWD_H
|
||||||
{
|
{
|
||||||
|
14
gmessages.c
14
gmessages.c
@@ -50,12 +50,10 @@ write (FILE *fd,
|
|||||||
|
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
#endif /* NATIVE_WIN32 */
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ensure_stdout_valid (void)
|
ensure_stdout_valid (void)
|
||||||
{
|
{
|
||||||
#ifdef NATIVE_WIN32
|
|
||||||
HANDLE handle;
|
HANDLE handle;
|
||||||
|
|
||||||
handle = GetStdHandle (STD_OUTPUT_HANDLE);
|
handle = GetStdHandle (STD_OUTPUT_HANDLE);
|
||||||
@@ -65,8 +63,10 @@ ensure_stdout_valid (void)
|
|||||||
AllocConsole ();
|
AllocConsole ();
|
||||||
freopen ("CONOUT$", "w", stdout);
|
freopen ("CONOUT$", "w", stdout);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
#define ensure_stdout_valid() /* Define as empty */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* --- structures --- */
|
/* --- structures --- */
|
||||||
@@ -429,7 +429,6 @@ g_log_default_handler (const gchar *log_domain,
|
|||||||
* DOS prompt.
|
* DOS prompt.
|
||||||
*/
|
*/
|
||||||
fd = stdout;
|
fd = stdout;
|
||||||
ensure_stdout_valid ();
|
|
||||||
#else
|
#else
|
||||||
fd = (log_level >= G_LOG_LEVEL_MESSAGE) ? 1 : 2;
|
fd = (log_level >= G_LOG_LEVEL_MESSAGE) ? 1 : 2;
|
||||||
#endif
|
#endif
|
||||||
@@ -450,6 +449,7 @@ g_log_default_handler (const gchar *log_domain,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/* use write(2) for output, in case we are out of memeory */
|
/* use write(2) for output, in case we are out of memeory */
|
||||||
|
ensure_stdout_valid ();
|
||||||
if (log_domain)
|
if (log_domain)
|
||||||
{
|
{
|
||||||
write (fd, "\n", 1);
|
write (fd, "\n", 1);
|
||||||
@@ -469,6 +469,7 @@ g_log_default_handler (const gchar *log_domain,
|
|||||||
write (fd, "\n", 1);
|
write (fd, "\n", 1);
|
||||||
break;
|
break;
|
||||||
case G_LOG_LEVEL_CRITICAL:
|
case G_LOG_LEVEL_CRITICAL:
|
||||||
|
ensure_stdout_valid ();
|
||||||
if (log_domain)
|
if (log_domain)
|
||||||
{
|
{
|
||||||
write (fd, "\n", 1);
|
write (fd, "\n", 1);
|
||||||
@@ -494,6 +495,7 @@ g_log_default_handler (const gchar *log_domain,
|
|||||||
local_glib_warning_func (message);
|
local_glib_warning_func (message);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
ensure_stdout_valid ();
|
||||||
if (log_domain)
|
if (log_domain)
|
||||||
{
|
{
|
||||||
write (fd, "\n", 1);
|
write (fd, "\n", 1);
|
||||||
@@ -519,6 +521,7 @@ g_log_default_handler (const gchar *log_domain,
|
|||||||
local_glib_message_func (message);
|
local_glib_message_func (message);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
ensure_stdout_valid ();
|
||||||
if (log_domain)
|
if (log_domain)
|
||||||
{
|
{
|
||||||
write (fd, log_domain, strlen (log_domain));
|
write (fd, log_domain, strlen (log_domain));
|
||||||
@@ -535,6 +538,7 @@ g_log_default_handler (const gchar *log_domain,
|
|||||||
write (fd, "\n", 1);
|
write (fd, "\n", 1);
|
||||||
break;
|
break;
|
||||||
case G_LOG_LEVEL_INFO:
|
case G_LOG_LEVEL_INFO:
|
||||||
|
ensure_stdout_valid ();
|
||||||
if (log_domain)
|
if (log_domain)
|
||||||
{
|
{
|
||||||
write (fd, log_domain, strlen (log_domain));
|
write (fd, log_domain, strlen (log_domain));
|
||||||
@@ -551,6 +555,7 @@ g_log_default_handler (const gchar *log_domain,
|
|||||||
write (fd, "\n", 1);
|
write (fd, "\n", 1);
|
||||||
break;
|
break;
|
||||||
case G_LOG_LEVEL_DEBUG:
|
case G_LOG_LEVEL_DEBUG:
|
||||||
|
ensure_stdout_valid ();
|
||||||
if (log_domain)
|
if (log_domain)
|
||||||
{
|
{
|
||||||
write (fd, log_domain, strlen (log_domain));
|
write (fd, log_domain, strlen (log_domain));
|
||||||
@@ -570,6 +575,7 @@ g_log_default_handler (const gchar *log_domain,
|
|||||||
/* we are used for a log level that is not defined by GLib itself,
|
/* we are used for a log level that is not defined by GLib itself,
|
||||||
* try to make the best out of it.
|
* try to make the best out of it.
|
||||||
*/
|
*/
|
||||||
|
ensure_stdout_valid ();
|
||||||
if (log_domain)
|
if (log_domain)
|
||||||
{
|
{
|
||||||
write (fd, log_domain, strlen (log_domain));
|
write (fd, log_domain, strlen (log_domain));
|
||||||
|
44
gutils.c
44
gutils.c
@@ -411,30 +411,32 @@ g_get_any_init (void)
|
|||||||
#endif /* NATIVE_WIN32 */
|
#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)
|
if (!g_home_dir)
|
||||||
g_home_dir = g_strdup (g_getenv ("HOME"));
|
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
|
#ifdef HAVE_PWD_H
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user