vte r2046 - in trunk: . src
- From: cpwilson svn gnome org
- To: svn-commits-list gnome org
- Subject: vte r2046 - in trunk: . src
- Date: Wed, 21 May 2008 07:36:14 +0000 (UTC)
Author: cpwilson
Date: Wed May 21 07:36:14 2008
New Revision: 2046
URL: http://svn.gnome.org/viewvc/vte?rev=2046&view=rev
Log:
2008-05-21 Chris Wilson <chris chris-wilson co uk>
* src/pty.c (merge_environ): Silence compiler warning about using
environ as a local variable name.
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:36:14 2008
@@ -269,14 +269,15 @@
merge_environ (char **envp)
{
GHashTable *table;
- gchar **environ;
+ gchar **parent_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]);
+
+ parent_environ = g_listenv ();
+ for (i = 0; parent_environ[i] != NULL; i++) {
+ gchar *name = g_strdup (parent_environ[i]);
gchar *value = strchr (name, '=');
if (value) {
*value = '\0';
@@ -284,6 +285,8 @@
}
g_hash_table_replace (table, name, value);
}
+ g_strfreev (parent_environ);
+
if (envp != NULL) {
for (i = 0; envp[i] != NULL; i++) {
gchar *name = g_strdup (envp[i]);
@@ -296,8 +299,6 @@
}
}
- 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]