+ /* skip if last char is not a digit (i.e. not an address) */
+ /* (don't check first char - might be 11.22.33.44.an.isp) */
+ if (!*tok) return 0; /* nothing to check */
+ if (!isdigit(*(unsigned char*)tok+strlen(tok)-1)) return 0;
+
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = PF_UNSPEC;
+ hints.ai_socktype = SOCK_STREAM;
+#ifdef AI_NUMERICHOST
+ hints.ai_flags = AI_NUMERICHOST;
+#endif
+
+ gai = getaddrinfo(addr, NULL, &hints, &resa);
+ if (gai) return 0;
+
+ gai = getaddrinfo(tok, NULL, &hints, &rest);
+ if (p)
+ *p++ = '/';
+ if (gai) {