diff options
author | Tony Finch <fanf@FreeBSD.org> | 2016-03-31 12:13:01 +0000 |
---|---|---|
committer | Tony Finch <fanf@FreeBSD.org> | 2016-03-31 12:13:01 +0000 |
commit | 8efb5aa133377471301bad72273e7166cda36a71 (patch) | |
tree | 7e36bc8fc0fbac03b39b8d7796a83b46ca4ab859 /usr.bin/whois | |
parent | 055dba6df12480698e1d6f287fca51d848c6a26d (diff) | |
download | src-8efb5aa133377471301bad72273e7166cda36a71.tar.gz src-8efb5aa133377471301bad72273e7166cda36a71.zip |
Notes
Diffstat (limited to 'usr.bin/whois')
-rw-r--r-- | usr.bin/whois/whois.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.bin/whois/whois.c b/usr.bin/whois/whois.c index 1630067f15ce..49b20057722b 100644 --- a/usr.bin/whois/whois.c +++ b/usr.bin/whois/whois.c @@ -431,9 +431,13 @@ done: else if ((flags & WHOIS_SPAM_ME) || strchr(query, ' ') != NULL) fprintf(fp, "%s\r\n", query); - else if (strcasecmp(hostname, ANICHOST) == 0) - fprintf(fp, "+ %s\r\n", query); - else if (strcasecmp(hostres->ai_canonname, VNICHOST) == 0) + else if (strcasecmp(hostname, ANICHOST) == 0) { + if (strncasecmp(query, "AS", 2) == 0 && + strspn(query+2, "0123456789") == strlen(query+2)) + fprintf(fp, "+ a %s\r\n", query+2); + else + fprintf(fp, "+ %s\r\n", query); + } else if (strcasecmp(hostres->ai_canonname, VNICHOST) == 0) fprintf(fp, "domain %s\r\n", query); else fprintf(fp, "%s\r\n", query); |