Fix the environment handling. (#504829, Cosimo Cecchi)
authorMatthias Clasen <mclasen@redhat.com>
Tue, 25 Dec 2007 02:07:48 +0000 (02:07 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Tue, 25 Dec 2007 02:07:48 +0000 (02:07 +0000)
2007-12-24  Matthias Clasen  <mclasen@redhat.com>

        * gdesktopappinfo.c (g_desktop_app_info_launch): Fix the
        environment handling.  (#504829, Cosimo Cecchi)

svn path=/trunk/; revision=6200

gio/ChangeLog
gio/gdesktopappinfo.c

index 779fc1b..6f1636e 100644 (file)
@@ -1,8 +1,13 @@
+2007-12-24  Matthias Clasen  <mclasen@redhat.com>
+
+       * gdesktopappinfo.c (g_desktop_app_info_launch): Fix the
+       environment handling.  (#504829, Cosimo Cecchi)
+
 2007-12-22  Matthias Clasen  <mclasen@redhat.com>
 
-       * gio/gappinfo.c: Doc improvements
+       * gappinfo.c: Doc improvements
        
-       * gio/gdesktopappinfo.c (g_app_info_get_all): Return app infos,
+       * gdesktopappinfo.c (g_app_info_get_all): Return app infos,
        not ids.
 
 2007-12-20  Matthias Clasen  <mclasen@redhat.com>
index c89ae9b..241e37f 100644 (file)
@@ -810,6 +810,16 @@ dup_list_segment (GList *start,
   return g_list_reverse (res);
 }
 
+#ifdef HAVE__NSGETENVIRON
+#define environ (*_NSGetEnviron())
+#elif !defined(G_OS_WIN32)
+
+/* According to the Single Unix Specification, environ is not in 
+ *  * any system header, although unistd.h often declares it.
+ *   */
+extern char **environ;
+#endif
+
 static gboolean
 g_desktop_app_info_launch (GAppInfo           *appinfo,
                           GList              *files,
@@ -862,7 +872,12 @@ g_desktop_app_info_launch (GAppInfo           *appinfo,
          
          if (display || sn_id)
            {
-             envp = g_listenv ();
+#ifdef G_OS_WIN32
+             /* FIXME */
+             envp = g_new0 (char *, 1);
+#else
+             envp = g_strdupv (environ);
+#endif
              
              if (display)
                envp = replace_env_var (envp,