Deleted Added
full compact
whois.c (138681) whois.c (146752)
1/*
2 * Copyright (c) 1980, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 30 unchanged lines hidden (view full) ---

39
40#if 0
41#ifndef lint
42static char sccsid[] = "@(#)whois.c 8.1 (Berkeley) 6/6/93";
43#endif /* not lint */
44#endif
45
46#include <sys/cdefs.h>
1/*
2 * Copyright (c) 1980, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 30 unchanged lines hidden (view full) ---

39
40#if 0
41#ifndef lint
42static char sccsid[] = "@(#)whois.c 8.1 (Berkeley) 6/6/93";
43#endif /* not lint */
44#endif
45
46#include <sys/cdefs.h>
47__FBSDID("$FreeBSD: head/usr.bin/whois/whois.c 138681 2004-12-11 13:14:07Z ceri $");
47__FBSDID("$FreeBSD: head/usr.bin/whois/whois.c 146752 2005-05-29 15:49:53Z charnier $");
48
49#include <sys/types.h>
50#include <sys/socket.h>
51#include <netinet/in.h>
52#include <arpa/inet.h>
53#include <ctype.h>
54#include <err.h>
55#include <netdb.h>

--- 218 unchanged lines hidden (view full) ---

274whois(const char *query, const char *hostname, int flags)
275{
276 FILE *sfi, *sfo;
277 struct addrinfo *hostres, *res;
278 char *buf, *host, *nhost, *p;
279 int i, s;
280 size_t c, len;
281
48
49#include <sys/types.h>
50#include <sys/socket.h>
51#include <netinet/in.h>
52#include <arpa/inet.h>
53#include <ctype.h>
54#include <err.h>
55#include <netdb.h>

--- 218 unchanged lines hidden (view full) ---

274whois(const char *query, const char *hostname, int flags)
275{
276 FILE *sfi, *sfo;
277 struct addrinfo *hostres, *res;
278 char *buf, *host, *nhost, *p;
279 int i, s;
280 size_t c, len;
281
282 s = -1;
282 hostres = gethostinfo(hostname, 1);
283 for (res = hostres; res; res = res->ai_next) {
284 s = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
285 if (s < 0)
286 continue;
287 if (connect(s, res->ai_addr, res->ai_addrlen) == 0)
288 break;
289 close(s);

--- 72 unchanged lines hidden ---
283 hostres = gethostinfo(hostname, 1);
284 for (res = hostres; res; res = res->ai_next) {
285 s = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
286 if (s < 0)
287 continue;
288 if (connect(s, res->ai_addr, res->ai_addrlen) == 0)
289 break;
290 close(s);

--- 72 unchanged lines hidden ---