} else if (!isdigit(*strptr)) {
} else if (!isdigit(UCH(*strptr))) {
PUBLIC int HTParseInet ARGS2(	SockA *,	soc_in,	CONST char *,	str){    char *port;    int dotcount_ip = 0;	/* for dotted decimal IP addr */#ifndef _WINDOWS_NSL    char *host = NULL;#endif /* _WINDOWS_NSL */    if (!str) {	CTRACE(tfp, "HTParseInet: Can't parse `NULL'.\n");	return -1;    }    CTRACE(tfp, "HTParseInet: parsing `%s'.\n", str);    if (HTCheckForInterrupt()) {	CTRACE (tfp, "HTParseInet: INTERRUPTED for '%s'.\n", str);	return -1;    }#ifdef _WINDOWS_NSL    strncpy(host, str, (size_t)512);#else    StrAllocCopy(host, str);	/* Make a copy we can mutilate */#endif /*  _WINDOWS_NSL */    /*    **	Parse port number if present.    */    if ((port = strchr(host, ':')) != NULL) {	*port++ = 0;		/* Chop off port */	if (port[0] >= '0' && port[0] <= '9') {#ifdef unix	    soc_in->sin_port = htons(atol(port));#else /* VMS: */#ifdef DECNET	    soc_in->sdn_objnum = (unsigned char)(strtol(port, (char**)0, 10));#else	    soc_in->sin_port = htons((unsigned short)strtol(port,(char**)0,10));#endif /* Decnet */#endif /* Unix vs. VMS */#ifdef SUPPRESS 	/* 1. crashes!?!.  2. Not recommended */	} else {	    struct servent * serv = getservbyname(port, (char*)0);	    if (serv) {		soc_in->sin_port = serv->s_port;	    } else {		CTRACE(tfp, "TCP: Unknown service %s\n", port);	    }#endif /* SUPPRESS */	}    }#ifdef DECNET    /*    **	Read Decnet node name. @@ Should know about DECnet addresses, but    **	it's probably worth waiting until the Phase transition from IV to V.    */    soc_in->sdn_nam.n_len = min(DN_MAXNAML, strlen(host));  /* <=6 in phase 4 */    strncpy(soc_in->sdn_nam.n_name, host, soc_in->sdn_nam.n_len + 1);    CTRACE(tfp, "DECnet: Parsed address as object number %d on host %.6s...\n",		soc_in->sdn_objnum, host);#else  /* parse Internet host: */    if (*host >= '0' && *host <= '9') {   /* Test for numeric node address: */	char *strptr = host;	while (*strptr) {	    if (*strptr == '.') {		dotcount_ip++;	    } else if (!isdigit(*strptr)) {		break;	    }	    strptr++;	}	if (*strptr) {		/* found non-numeric, assume domain name */	    dotcount_ip = 0;	}    }    /*    **	Parse host number if present.    */    if (dotcount_ip == 3) {   /* Numeric node address: */#ifdef DJGPP	soc_in->sin_addr.s_addr = htonl(aton(host));#else#ifdef DGUX_OLD	soc_in->sin_addr.s_addr = inet_addr(host).s_addr; /* See arpa/inet.h */#else#ifdef GUSI	soc_in->sin_addr = inet_addr(host);		/* See netinet/in.h */#else#ifdef HAVE_INET_ATON	if (!inet_aton(host, &(soc_in->sin_addr))) {	    CTRACE(tfp, "inet_aton(%s) returns error\n", host);#ifndef _WINDOWS_NSL	    FREE(host);#endif /* _WINDOWS_NSL */	    return -1;	}#else	soc_in->sin_addr.s_addr = inet_addr(host);	/* See arpa/inet.h */#endif /* HAVE_INET_ATON */#endif /* GUSI */#endif /* DGUX_OLD */#endif /* DJGPP */#ifndef _WINDOWS_NSL	FREE(host);#endif /* _WINDOWS_NSL */    } else {		    /* Alphanumeric node name: */#ifdef MVS	/* Outstanding problem with crash in MVS gethostbyname */	CTRACE(tfp, "HTParseInet: Calling LYGetHostByName(%s)\n", host);#endif /* MVS */#ifdef DJGPP	if (!valid_hostname(host)) {	    FREE(host);	    return HT_NOT_ACCEPTABLE; /* only HTDoConnect checks this. */	}	soc_in->sin_addr.s_addr = htonl(resolve(host));	if (soc_in->sin_addr.s_addr == 0) {	    goto failed;	}#else /* !DJGPP: */#ifdef _WINDOWS_NSL	phost = LYGetHostByName(host);	/* See above */	if (!phost) goto failed;	memcpy((void *)&soc_in->sin_addr, phost->h_addr, phost->h_length);#else /* !DJGPP, !_WINDOWS_NSL: */	{	    struct hostent  *phost;	    phost = LYGetHostByName(host);	/* See above */	    if (!phost) goto failed;#if defined(VMS) && defined(CMU_TCP)	    /*	    **  In LIBCMU, phost->h_length contains not the length of one address	    **  (four bytes) but the number of bytes in *h_addr, i.e., some multiple	    **  of four.  Thus we need to hard code the value here, and remember to	    **  change it if/when IP addresses change in size. :-(	LIBCMU is no	    **  longer supported, and CMU users are encouraged to obtain and use	    **  SOCKETSHR/NETLIB instead. - S. Bjorndahl	    */	    memcpy((void *)&soc_in->sin_addr, phost->h_addr, 4);#else	    if (!phost) goto failed;	    if (phost->h_length != sizeof soc_in->sin_addr) {		HTAlwaysAlert(host, gettext("Address length looks invalid"));	    }	    memcpy((void *)&soc_in->sin_addr, phost->h_addr, phost->h_length);#endif /* VMS && CMU_TCP */	}#endif /* !DJGPP, !_WINDOWS_NSL */#endif /* !DJGPP */#ifndef _WINDOWS_NSL	FREE(host);#endif /* _WINDOWS_NSL */    }	/* Alphanumeric node name */    CTRACE(tfp, "HTParseInet: Parsed address as port %d, IP address %d.%d.%d.%d\n",		(int)ntohs(soc_in->sin_port),		(int)*((unsigned char *)(&soc_in->sin_addr)+0),		(int)*((unsigned char *)(&soc_in->sin_addr)+1),		(int)*((unsigned char *)(&soc_in->sin_addr)+2),		(int)*((unsigned char *)(&soc_in->sin_addr)+3));#endif	/* Internet vs. Decnet */    return 0;	/* OK */failed:    CTRACE(tfp, "HTParseInet: Can't find internet node name `%s'.\n",		host);#ifndef _WINDOWS_NSL    FREE(host);#endif /* _WINDOWS_NSL */    switch (lynx_nsl_status) {    case HT_NOT_ACCEPTABLE:    case HT_INTERRUPTED:	return lynx_nsl_status;    default:    return -1;}}