+Mon Jan 23 17:30:33 2006 Tim Janik <timj@imendio.com>
+
+ * glib/gutils.c (_g_getenv_nomalloc): wiped out all the wonderfull
+ G_OS_WIN32 code i wrote ;-[) after tml told me windows has getenv()
+ as well.
+
Mon Jan 23 16:46:20 2006 Tim Janik <timj@imendio.com>
* glib/gslice.c (slice_config_init): initialize GSlice config from
+Mon Jan 23 17:30:33 2006 Tim Janik <timj@imendio.com>
+
+ * glib/gutils.c (_g_getenv_nomalloc): wiped out all the wonderfull
+ G_OS_WIN32 code i wrote ;-[) after tml told me windows has getenv()
+ as well.
+
Mon Jan 23 16:46:20 2006 Tim Janik <timj@imendio.com>
* glib/gslice.c (slice_config_init): initialize GSlice config from
+Mon Jan 23 17:30:33 2006 Tim Janik <timj@imendio.com>
+
+ * glib/gutils.c (_g_getenv_nomalloc): wiped out all the wonderfull
+ G_OS_WIN32 code i wrote ;-[) after tml told me windows has getenv()
+ as well.
+
Mon Jan 23 16:46:20 2006 Tim Janik <timj@imendio.com>
* glib/gslice.c (slice_config_init): initialize GSlice config from
_g_getenv_nomalloc (const gchar *variable,
gchar buffer[1024])
{
-#ifndef G_OS_WIN32
const gchar *retval = getenv (variable);
if (retval && retval[0])
{
}
}
return NULL;
-#else /* G_OS_WIN32 */
- if (G_WIN32_HAVE_WIDECHAR_API ())
- {
- /* convert variable name to wchar_t without malloc */
- wchar_t wname[256], result[1024];
- gint i, l = strlen (variable);
- if (l >= 256)
- return NULL;
- for (i = 0; variable[i]; i++)
- wname[i] = variable[i];
- wname[i] = 0;
- l = GetEnvironmentVariableW (wname, result, 1024);
- if (l > 0 && l < 1024 && result[0])
- {
- /* convert variable contents from wchar_t without malloc */
- for (i = 0; i < l; i++)
- buffer[i] = result[i];
- buffer[i] = 0;
- return buffer;
- }
- return NULL;
- }
- else
- {
- gint l = GetEnvironmentVariableW (variable, buffer, 1024);
- if (l > 0 && l < 1024 && buffer[0])
- {
- buffer[l] = 0;
- return buffer;
- }
- return NULL;
- }
-#endif /* G_OS_WIN32 */
}
/**