Correct C99ism (mixed declarations and code) in Win32 ifdef branch.
authorTor Lillqvist <tml@novell.com>
Fri, 1 Sep 2006 23:32:05 +0000 (23:32 +0000)
committerTor Lillqvist <tml@src.gnome.org>
Fri, 1 Sep 2006 23:32:05 +0000 (23:32 +0000)
2006-09-02  Tor Lillqvist  <tml@novell.com>

* glib/gutils.c (g_get_any_init_do): Correct C99ism (mixed
declarations and code) in Win32 ifdef branch. (#353903, Mike
Edenfield)

ChangeLog
glib/gutils.c

index b345c4f..2f2de6a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-09-02  Tor Lillqvist  <tml@novell.com>
+
+       * glib/gutils.c (g_get_any_init_do): Correct C99ism (mixed
+       declarations and code) in Win32 ifdef branch. (#353903, Mike
+       Edenfield)
+
 2006-09-01  Abel Cheung  <abel@oaka.org>
 
        * configure.in: Added 'dz' 'hy' to ALL_LINGUAS.
index 66d03c8..72d9b68 100644 (file)
@@ -1627,14 +1627,16 @@ g_get_any_init_do (void)
 #else /* !HAVE_PWD_H */
   
 #ifdef G_OS_WIN32
-  guint len = UNLEN+1;
-  wchar_t buffer[UNLEN+1];
+  {
+    guint len = UNLEN+1;
+    wchar_t buffer[UNLEN+1];
     
-  if (GetUserNameW (buffer, (LPDWORD) &len))
-    {
-      g_user_name = g_utf16_to_utf8 (buffer, -1, NULL, NULL, NULL);
-      g_real_name = g_strdup (g_user_name);
-    }
+    if (GetUserNameW (buffer, (LPDWORD) &len))
+      {
+       g_user_name = g_utf16_to_utf8 (buffer, -1, NULL, NULL, NULL);
+       g_real_name = g_strdup (g_user_name);
+      }
+  }
 #endif /* G_OS_WIN32 */
 
 #endif /* !HAVE_PWD_H */