(doit_passive): parse $DISPLAY correctly
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@5192 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
11
appl/kx/kx.c
11
appl/kx/kx.c
@@ -329,14 +329,15 @@ doit_passive (char *host, char *user, int debugp, int keepalivep,
|
|||||||
if (connect (fd, (struct sockaddr *)&addr, sizeof(addr)) < 0)
|
if (connect (fd, (struct sockaddr *)&addr, sizeof(addr)) < 0)
|
||||||
err(1, "connect(%s)", host);
|
err(1, "connect(%s)", host);
|
||||||
{
|
{
|
||||||
int d;
|
int d = 0;
|
||||||
char *s;
|
char *s;
|
||||||
|
|
||||||
s = getenv ("DISPLAY");
|
s = getenv ("DISPLAY");
|
||||||
if (s == NULL || (s = strchr(s, ':')) == NULL)
|
if (s != NULL) {
|
||||||
d = 0;
|
s = strchr (s, ':');
|
||||||
else
|
if (s != NULL)
|
||||||
d = atoi (s);
|
d = atoi (s + 1);
|
||||||
|
}
|
||||||
|
|
||||||
xserver = connect_local_xsocket (d);
|
xserver = connect_local_xsocket (d);
|
||||||
if (xserver < 0)
|
if (xserver < 0)
|
||||||
|
Reference in New Issue
Block a user