version 1.11, 2000/07/12 18:01:57 |
version 1.12, 2001/10/04 19:28:58 |
|
|
int flags; |
int flags; |
{ |
{ |
FILE *sfi, *sfo; |
FILE *sfi, *sfo; |
char *buf, *p, *nhost; |
char *buf, *p, *nhost, *nbuf = NULL; |
size_t len; |
size_t len; |
int s, nomatch; |
int s, nomatch; |
const char *reason = NULL; |
const char *reason = NULL; |
|
|
while ((buf = fgetln(sfi, &len))) { |
while ((buf = fgetln(sfi, &len))) { |
if (buf[len - 2] == '\r') |
if (buf[len - 2] == '\r') |
buf[len - 2] = '\0'; |
buf[len - 2] = '\0'; |
else |
else if (buf[len - 1] == '\n') |
buf[len - 1] = '\0'; |
buf[len - 1] = '\0'; |
|
else { |
|
nbuf = malloc(len + 1); |
|
memcpy(nbuf, buf, len); |
|
nbuf[len] = '\0'; |
|
buf = nbuf; |
|
} |
|
|
if ((flags & WHOIS_RECURSE) && !nhost && |
if ((flags & WHOIS_RECURSE) && !nhost && |
(p = strstr(buf, "Whois Server: "))) { |
(p = strstr(buf, "Whois Server: "))) { |
|
|
} |
} |
(void)puts(buf); |
(void)puts(buf); |
} |
} |
|
if (nbuf) |
|
free(nbuf); |
|
|
/* Do second lookup as needed */ |
/* Do second lookup as needed */ |
if (nomatch && !nhost) { |
if (nomatch && !nhost) { |