Fix the environment handling. (#504829, Cosimo Cecchi)

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
This commit is contained in:
Matthias Clasen 2007-12-25 02:07:48 +00:00 committed by Matthias Clasen
parent cce26f9ee5
commit c58f339401
2 changed files with 23 additions and 3 deletions

View 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>

View 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,