[dia] Use g_listenv() rather than runtime variable _environ



commit e0b81659369bd1546f728bacef72f6ea7b247aa2
Author: Hans Breuer <hans breuer org>
Date:   Wed Aug 19 10:51:11 2009 +0200

    Use g_listenv() rather than runtime variable _environ

 app/winmain.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/app/winmain.c b/app/winmain.c
index 7a1eaec..2c8c989 100644
--- a/app/winmain.c
+++ b/app/winmain.c
@@ -129,7 +129,8 @@ dia_redirect_console (void)
 
   if (file != INVALID_HANDLE_VALUE)
     {
-      char* log2 = g_strjoinv("\r\n", _environ);
+      gchar** envlist = g_listenv ();
+      char* log2 = g_strjoinv("\r\n", envlist);
       char* log = g_strdup_printf ("Dia (%s) instance %d started "
                                    "using Gtk %d.%d.%d (%d)\r\n%s\r\n", 
                                    VERSION, i + 1,
@@ -137,6 +138,7 @@ dia_redirect_console (void)
                                    log2);
       guint32 dwWritten; /* looks like being optional in msdn, but isn't */
       g_free (log2);
+      g_strfreev (envlist);
 
       if (!verbose || WriteFile (file, log, strlen(log), &dwWritten, 0))
         {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]