Use 'aay' instead of 'as' for environ

It might contain non-utf8 characters.
This commit is contained in:
Ryan Lortie 2010-10-29 16:33:47 -04:00
parent 641f622bfe
commit cb64773002
2 changed files with 9 additions and 4 deletions

View File

@ -573,10 +573,14 @@ get_platform_data (GApplication *application)
if (application->priv->flags & G_APPLICATION_SEND_ENVIRONMENT) if (application->priv->flags & G_APPLICATION_SEND_ENVIRONMENT)
{ {
gchar **envp = g_get_environ (); GVariant *array;
g_variant_builder_add (builder, "{sv}", "environ", gchar **envp;
g_variant_new_strv ((const gchar **) envp, -1));
envp = g_get_environ ();
array = g_variant_new_bytestring_array ((const gchar **) envp, -1);
g_strfreev (envp); g_strfreev (envp);
g_variant_builder_add (builder, "{sv}", "environ", array);
} }
G_APPLICATION_GET_CLASS (application)-> G_APPLICATION_GET_CLASS (application)->

View File

@ -111,7 +111,8 @@ grok_platform_data (GApplicationCommandLine *cmdline)
else if (strcmp (key, "environ") == 0) else if (strcmp (key, "environ") == 0)
{ {
if (!cmdline->priv->environ) if (!cmdline->priv->environ)
cmdline->priv->environ = g_variant_get_strv (value, NULL); cmdline->priv->environ =
g_variant_get_bytestring_array (value, NULL);
} }
} }