summaryrefslogtreecommitdiff
path: root/whois.c
diff options
context:
space:
mode:
authorMarco d'Itri <md@linux.it>2006-09-15 00:07:49 +0200
committerMarco d'Itri <md@linux.it>2013-03-30 02:31:34 +0100
commite5c1a36ec18e55c8c0a658b3dda5d8746f5d6a61 (patch)
tree9e85bcf6e1e56f9b0265c60aaaf7ed933c2ab0ec /whois.c
parent7c5dbcc6c6607a113e3414483d9f2b23f55d5070 (diff)
downloadwhois-e5c1a36ec18e55c8c0a658b3dda5d8746f5d6a61.tar.gz
Imported Debian version 4.7.16v4.7.16
Diffstat (limited to 'whois.c')
-rw-r--r--whois.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/whois.c b/whois.c
index 3d52e72..159a665 100644
--- a/whois.c
+++ b/whois.c
@@ -432,7 +432,7 @@ const char *whereas(const unsigned short asn)
char *queryformat(const char *server, const char *flags, const char *query)
{
- char *buf;
+ char *buf, *p;
int i, isripe = 0;
/* 64 bytes reserved for server-specific flags added later */
@@ -480,6 +480,9 @@ char *queryformat(const char *server, const char *flags, const char *query)
sprintf(buf, "%s/e", query); /* ask for english text */
else
strcat(buf, query);
+ } else if (!isripe && strcmp(server, "whois.arin.net") == 0 &&
+ (p = strrchr(query, '/'))) {
+ strncat(buf, query, p - query); /* strip CIDR */
} else
strcat(buf, query);
return buf;