version 1.17, 1998/07/01 19:31:12 |
version 1.18, 1998/07/09 06:32:10 |
|
|
if ((ep = env_find("DISPLAY")) |
if ((ep = env_find("DISPLAY")) |
&& ((*ep->value == ':') |
&& ((*ep->value == ':') |
|| (strncmp((char *)ep->value, "unix:", 5) == 0))) { |
|| (strncmp((char *)ep->value, "unix:", 5) == 0))) { |
char hbuf[256+1]; |
char hbuf[MAXHOSTNAMELEN]; |
char *cp2 = strchr((char *)ep->value, ':'); |
char *cp2 = strchr((char *)ep->value, ':'); |
|
|
gethostname(hbuf, 256); |
gethostname(hbuf, sizeof hbuf); |
hbuf[256] = '\0'; |
|
|
|
/* If this is not the full name, try to get it via DNS */ |
/* If this is not the full name, try to get it via DNS */ |
if (strchr(hbuf, '.') == 0) { |
if (strchr(hbuf, '.') == 0) { |
struct hostent *he = gethostbyname(hbuf); |
struct hostent *he = gethostbyname(hbuf); |
if (he != 0) |
if (he != 0) |
strncpy(hbuf, he->h_name, 256); |
strncpy(hbuf, he->h_name, sizeof hbuf); |
hbuf[256] = '\0'; |
hbuf[256] = '\0'; |
} |
} |
|
|