(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:
Assar Westerlund
1998-11-18 09:24:44 +00:00
parent 88e3d66749
commit 2fcba2d23b

View File

@@ -329,14 +329,15 @@ doit_passive (char *host, char *user, int debugp, int keepalivep,
if (connect (fd, (struct sockaddr *)&addr, sizeof(addr)) < 0)
err(1, "connect(%s)", host);
{
int d;
int d = 0;
char *s;
s = getenv ("DISPLAY");
if (s == NULL || (s = strchr(s, ':')) == NULL)
d = 0;
else
d = atoi (s);
if (s != NULL) {
s = strchr (s, ':');
if (s != NULL)
d = atoi (s + 1);
}
xserver = connect_local_xsocket (d);
if (xserver < 0)