diff options
Diffstat (limited to 'src/terminal.c')
-rw-r--r-- | src/terminal.c | 16 |
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); |