From bc2e7cde154615b8cc88cbb906b645c3b703edf8 Mon Sep 17 00:00:00 2001 From: Nikos Ntarmos Date: Sun, 15 Mar 2009 09:50:56 +0100 Subject: [PATCH] uicb: check before overwriting DISPLAY (FS#318) Signed-off-by: Julien Danjou --- uicb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/uicb.c b/uicb.c index 67ad46bb0..68dba6fa4 100644 --- a/uicb.c +++ b/uicb.c @@ -110,10 +110,11 @@ uicb_spawn(int screen, char *arg) if(!globalconf.screens_info->xinerama_is_active && (tmp = getenv("DISPLAY"))) { display = a_strdup(tmp); - if((tmp = strrchr(display, '.'))) + if ((tmp = strrchr(display, '.')) && !strchr(tmp, ':')) *tmp = '\0'; snprintf(newdisplay, sizeof(newdisplay), "%s.%d", display, screen); setenv("DISPLAY", newdisplay, 1); + p_delete(&display); }