wiped out all the wonderfull G_OS_WIN32 code i wrote ;-[) after tml told
authorTim Janik <timj@imendio.com>
Mon, 23 Jan 2006 16:32:22 +0000 (16:32 +0000)
committerTim Janik <timj@src.gnome.org>
Mon, 23 Jan 2006 16:32:22 +0000 (16:32 +0000)
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.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-12
glib/gutils.c

index bfecd6a..482516a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+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
index bfecd6a..482516a 100644 (file)
@@ -1,3 +1,9 @@
+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
index bfecd6a..482516a 100644 (file)
@@ -1,3 +1,9 @@
+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
index 7bcd0bc..b0df1f4 100644 (file)
@@ -1170,7 +1170,6 @@ const gchar*
 _g_getenv_nomalloc (const gchar *variable,
                     gchar        buffer[1024])
 {
-#ifndef G_OS_WIN32
   const gchar *retval = getenv (variable);
   if (retval && retval[0])
     {
@@ -1183,39 +1182,6 @@ _g_getenv_nomalloc (const gchar *variable,
         }
     }
   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 */
 }
 
 /**