Use 'aay' instead of 'as' for environ
authorRyan Lortie <desrt@desrt.ca>
Fri, 29 Oct 2010 20:33:47 +0000 (16:33 -0400)
committerRyan Lortie <desrt@desrt.ca>
Fri, 29 Oct 2010 20:33:47 +0000 (16:33 -0400)
It might contain non-utf8 characters.

gio/gapplication.c
gio/gapplicationcommandline.c

index 544875f..4ca811c 100644 (file)
@@ -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)->
index 853cde2..2cb0691 100644 (file)
@@ -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);
       }
 }