uicb: check before overwriting DISPLAY (FS#318)
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
2a82b09a73
commit
bc2e7cde15
3
uicb.c
3
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);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue