$NetBSD: patch-af,v 1.4 1998/10/11 21:07:11 kim Exp $ *** pbuf.c.orig Tue Oct 6 03:49:59 1998 --- pbuf.c Sun Oct 11 15:45:15 1998 *************** *** 265,270 **** --- 265,271 ---- void init_counters() { char *p; struct servent *svnt; + struct hostent *hent; (void)setsignal(SIGWINCH, windowSizeChanged); *************** *** 272,287 **** * The name of the local domain is now calculated properly * Kimmo Suominen */ ! if((getdomainname(domainName, MAXHOSTNAMELEN) != 0) ! || (domainName[0] == '\0')) ! { ! if ((gethostname(domainName, MAXHOSTNAMELEN) == 0) ! && ((p = memchr(domainName, '.', MAXHOSTNAMELEN)) != NULL)) { domainName[MAXHOSTNAMELEN - 1] = '\0'; ! memmove(domainName, ++p, MAXHOSTNAMELEN + domainName - p); ! } else ! domainName[0] = '\0'; ! } init_curses(); resetStats(); --- 273,290 ---- * The name of the local domain is now calculated properly * Kimmo Suominen */ ! if (gethostname(domainName, MAXHOSTNAMELEN) == 0) { ! if ((p = memchr(domainName, '.', MAXHOSTNAMELEN)) != NULL) { ! domainName[MAXHOSTNAMELEN - 1] = '\0'; ! memmove(domainName, ++p, MAXHOSTNAMELEN + domainName - p); ! } else ! if (((hent = gethostbyname(domainName)) != NULL) ! && ((p = strchr(hent->h_name, '.')) != NULL)) { ! strncpy(domainName, ++p, MAXHOSTNAMELEN); domainName[MAXHOSTNAMELEN - 1] = '\0'; ! } ! } else ! domainName[0] = '\0'; init_curses(); resetStats();