Deleted Added
full compact
common.c (178234) common.c (198339)
1/*-
2 * Copyright (c) 1998-2004 Dag-Erling Co�dan Sm�rgrav
3 * 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

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

22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1998-2004 Dag-Erling Co�dan Sm�rgrav
3 * 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

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

22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29#include <sys/cdefs.h>
30__FBSDID("$FreeBSD: head/lib/libfetch/common.c 178234 2008-04-15 23:29:51Z cperciva $");
30__FBSDID("$FreeBSD: head/lib/libfetch/common.c 198339 2009-10-21 18:29:26Z fabient $");
31
32#include <sys/param.h>
33#include <sys/socket.h>
34#include <sys/time.h>
35#include <sys/uio.h>
36
37#include <netinet/in.h>
38

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

767 p++;
768
769 /* position q at the first separator character */
770 for (q = p; *q; ++q)
771 if (*q == ',' || isspace((unsigned char)*q))
772 break;
773
774 d_len = q - p;
31
32#include <sys/param.h>
33#include <sys/socket.h>
34#include <sys/time.h>
35#include <sys/uio.h>
36
37#include <netinet/in.h>
38

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

767 p++;
768
769 /* position q at the first separator character */
770 for (q = p; *q; ++q)
771 if (*q == ',' || isspace((unsigned char)*q))
772 break;
773
774 d_len = q - p;
775 if (d_len > 0 && h_len > d_len &&
775 if (d_len > 0 && h_len >= d_len &&
776 strncasecmp(host + h_len - d_len,
777 p, d_len) == 0) {
778 /* domain name matches */
779 return (1);
780 }
781
782 p = q + 1;
783 } while (*q);
784
785 return (0);
786}
776 strncasecmp(host + h_len - d_len,
777 p, d_len) == 0) {
778 /* domain name matches */
779 return (1);
780 }
781
782 p = q + 1;
783 } while (*q);
784
785 return (0);
786}