vte r2045 - in trunk: . src



Author: cpwilson
Date: Wed May 21 07:32:36 2008
New Revision: 2045
URL: http://svn.gnome.org/viewvc/vte?rev=2045&view=rev

Log:
2008-05-21  Richard Hult  <richard imendio com>

    Bug 534148 â Use g_listenv() instead of environ

    * src/pty.c: (merge_environ): Use g_listenv() instead of
    non-portable environ extern.



Modified:
   trunk/ChangeLog
   trunk/src/pty.c

Modified: trunk/src/pty.c
==============================================================================
--- trunk/src/pty.c	(original)
+++ trunk/src/pty.c	Wed May 21 07:32:36 2008
@@ -64,8 +64,6 @@
 static GTree *_vte_pty_helper_map = NULL;
 #endif
 
-extern char **environ;
-
 /* Reset the handlers for all known signals to their defaults.  The parent
  * (or one of the libraries it links to) may have changed one to be ignored. */
 static void
@@ -271,10 +269,12 @@
 merge_environ (char **envp)
 {
 	GHashTable *table;
+	gchar **environ;
 	GPtrArray *array;
 	gint i;
 
 	table = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
+	environ = g_listenv ();
 	for (i = 0; environ[i] != NULL; i++) {
 		gchar *name = g_strdup (environ[i]);
 		gchar *value = strchr (name, '=');
@@ -296,6 +296,8 @@
 		}
 	}
 
+	g_strfreev (environ);
+
 	array = g_ptr_array_sized_new (g_hash_table_size (table) + 1);
 	g_hash_table_foreach (table, (GHFunc) collect_variables, array);
 	g_hash_table_destroy (table);



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