Fix a bug in uicb_spawn when using IP address in DISPLAY

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-03-22 21:15:59 +01:00
parent 74ab56b1b2
commit a52832b57d
1 changed files with 2 additions and 1 deletions

View File

@ -73,7 +73,8 @@ uicb_spawn(int screen, char *arg)
if(!XineramaIsActive(globalconf.display) && (tmp = getenv("DISPLAY")))
{
display = a_strdup(tmp);
if((tmp = strrchr(display, '.')))
tmp = strchr(display, ':');
if(tmp && (tmp = strrchr(tmp, '.')))
*tmp = '\0';
snprintf(newdisplay, sizeof(newdisplay), "%s.%d", display, screen);
setenv("DISPLAY", newdisplay, 1);