[glib] Use 'aay' instead of 'as' for environ
- From: Ryan Lortie <ryanl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] Use 'aay' instead of 'as' for environ
- Date: Fri, 29 Oct 2010 20:34:08 +0000 (UTC)
commit cb647730029d5da388637e2a532f7f54a0d86f47
Author: Ryan Lortie <desrt desrt ca>
Date: Fri Oct 29 16:33:47 2010 -0400
Use 'aay' instead of 'as' for environ
It might contain non-utf8 characters.
gio/gapplication.c | 10 +++++++---
gio/gapplicationcommandline.c | 3 ++-
2 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/gio/gapplication.c b/gio/gapplication.c
index 544875f..4ca811c 100644
--- a/gio/gapplication.c
+++ b/gio/gapplication.c
@@ -573,10 +573,14 @@ get_platform_data (GApplication *application)
if (application->priv->flags & G_APPLICATION_SEND_ENVIRONMENT)
{
- gchar **envp = g_get_environ ();
- g_variant_builder_add (builder, "{sv}", "environ",
- g_variant_new_strv ((const gchar **) envp, -1));
+ GVariant *array;
+ gchar **envp;
+
+ envp = g_get_environ ();
+ array = g_variant_new_bytestring_array ((const gchar **) envp, -1);
g_strfreev (envp);
+
+ g_variant_builder_add (builder, "{sv}", "environ", array);
}
G_APPLICATION_GET_CLASS (application)->
diff --git a/gio/gapplicationcommandline.c b/gio/gapplicationcommandline.c
index 853cde2..2cb0691 100644
--- a/gio/gapplicationcommandline.c
+++ b/gio/gapplicationcommandline.c
@@ -111,7 +111,8 @@ grok_platform_data (GApplicationCommandLine *cmdline)
else if (strcmp (key, "environ") == 0)
{
if (!cmdline->priv->environ)
- cmdline->priv->environ = g_variant_get_strv (value, NULL);
+ cmdline->priv->environ =
+ g_variant_get_bytestring_array (value, NULL);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]