summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormonsta <[email protected]>2016-01-13 10:49:46 +0300
committermonsta <[email protected]>2016-01-13 10:49:46 +0300
commit115663c4e2b65a5760b8bb002a97aaf0dcfbb0d9 (patch)
treee9092f208f84ec866612fbae99ed41401664d073
parent0d20d5008bbc04545ac7b1d7c66d83344ce97c4c (diff)
downloadmate-terminal-115663c4e2b65a5760b8bb002a97aaf0dcfbb0d9.tar.bz2
mate-terminal-115663c4e2b65a5760b8bb002a97aaf0dcfbb0d9.tar.xz
use g_get_environ
from https://git.gnome.org/browse/gnome-terminal/commit?id=a9e294229521d91c916dba765c773fcf85260a5b
-rw-r--r--src/terminal.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/terminal.c b/src/terminal.c
index e0addf0..a80a58b 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -309,7 +309,7 @@ name_lost_cb (GDBusConnection *connection,
OwnData *data = (OwnData *) user_data;
GError *error = NULL;
char **envv;
- int envc, i;
+ int i;
GVariantBuilder builder;
GVariant *value;
GString *string;
@@ -345,21 +345,15 @@ name_lost_cb (GDBusConnection *connection,
g_variant_builder_add (&builder, "@ay", string_to_ay (data->options->startup_id));
string = g_string_new (NULL);
- envv = g_listenv ();
- envc = g_strv_length (envv);
- for (i = 0; i < envc; ++i)
+ envv = g_get_environ ();
+ for (i = 0; envv[i]; ++i)
{
- const char *value;
-
- value = g_getenv (envv[i]);
- if (value == NULL)
- continue;
-
if (i > 0)
g_string_append_c (string, '\0');
- g_string_append_printf (string, "%s=%s", envv[i], value);
+ g_string_append (string, envv[i]);
}
+ g_strfreev (envv);
len = string->len;
s = g_string_free (string, FALSE);