]> Dogcows Code - chaz/openbox/commitdiff
use setenv/unsetenv instead of putenv, cuz they are not ugly and confusing wrt memory...
authorDana Jansens <danakj@orodu.net>
Sun, 27 Jan 2008 08:48:49 +0000 (03:48 -0500)
committerDana Jansens <danakj@orodu.net>
Sun, 27 Jan 2008 09:25:09 +0000 (04:25 -0500)
openbox/actions/execute.c
openbox/openbox.c
openbox/startupnotify.c

index 9ab20d7119c2aa9b276db33a842d55db26120596..a857b1b83e45e242d5c411872b289e5b0722b9ce 100644 (file)
@@ -4,6 +4,10 @@
 #include "openbox/screen.h"
 #include "gettext.h"
 
+#ifdef HAVE_STDLIB_H
+#  include <stdlib.h>
+#endif
+
 typedef struct {
     gchar   *cmd;
     gboolean sn;
index d1841437cdc25e5f43e5d9b1b79d9c5eb4ea8ca4..18c34d2f9c47427ba67e6753f986a9ddc41006b8 100644 (file)
@@ -194,7 +194,7 @@ gint main(gint argc, gchar **argv)
 
     /* set the DISPLAY environment variable for any lauched children, to the
        display we're using, so they open in the right place. */
-    putenv(g_strdup_printf("DISPLAY=%s", DisplayString(ob_display)));
+    setenv("DISPLAY", DisplayString(ob_display), TRUE);
 
     /* create available cursors */
     cursors[OB_CURSOR_NONE] = None;
@@ -516,7 +516,7 @@ static void remove_args(gint *argc, gchar **argv, gint index, gint num)
 static void parse_env()
 {
     /* unset this so we don't pass it on unknowingly */
-    putenv(g_strdup("DESKTOP_STARTUP_ID"));
+    unsetenv("DESKTOP_STARTUP_ID");
 }
 
 static void parse_args(gint *argc, gchar **argv)
index e9bb8310a0433989bac5254a8bbc07073a3e944d..e13aa55c688a55f84f50a66d6ebaa9392c389a34 100644 (file)
@@ -21,7 +21,9 @@
 #include "gettext.h"
 #include "event.h"
 
-#include <stdlib.h>
+#ifdef HAVE_STDLIB_H
+#  include <stdlib.h>
+#endif
 
 #ifndef USE_LIBSN
 
@@ -264,7 +266,7 @@ void sn_setup_spawn_environment(const gchar *program, const gchar *name,
                              g_direct_equal,
                              (GDestroyNotify)sn_launcher_context_unref);
 
-    putenv(g_strdup_printf("DESKTOP_STARTUP_ID=%s", id));
+    setenv("DESKTOP_STARTUP_ID", id, TRUE);
 
     g_free(desc);
 }
This page took 0.025773 seconds and 4 git commands to generate.