X-Git-Url: http://www.privoxy.org/gitweb/?a=blobdiff_plain;f=urlmatch.c;h=3a9c865784a75f3eed315be14e35dcbd887a6237;hb=9d2f5ca1c5c10d5d74eda833c342c1e05e1586ea;hp=5fe605c1f9ff0e9725ca30944ddbb3dcf7465eba;hpb=8c3e4f19001300c07cb076353eba625e4729fdd2;p=privoxy.git diff --git a/urlmatch.c b/urlmatch.c index 5fe605c1..3a9c8657 100644 --- a/urlmatch.c +++ b/urlmatch.c @@ -1,4 +1,4 @@ -const char urlmatch_rcs[] = "$Id: urlmatch.c,v 1.63 2011/09/04 11:37:05 fabiankeil Exp $"; +const char urlmatch_rcs[] = "$Id: urlmatch.c,v 1.69 2012/03/09 16:24:36 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/urlmatch.c,v $ @@ -6,7 +6,7 @@ const char urlmatch_rcs[] = "$Id: urlmatch.c,v 1.63 2011/09/04 11:37:05 fabianke * Purpose : Declares functions to match URLs against URL * patterns. * - * Copyright : Written by and Copyright (C) 2001-2009 + * Copyright : Written by and Copyright (C) 2001-2011 * the Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written @@ -135,7 +135,7 @@ jb_err init_domain_components(struct http_request *http) /* map to lower case */ for (p = http->dbuffer; *p ; p++) { - *p = (char)tolower((int)(unsigned char)*p); + *p = (char)privoxy_tolower(*p); } /* split the domain name into components */ @@ -253,8 +253,8 @@ jb_err parse_http_url(const char *url, struct http_request *http, int require_pr */ if (*http->url == '*') { - if ( NULL == (http->path = strdup("*")) - || NULL == (http->hostport = strdup("")) ) + if (NULL == (http->path = strdup("*")) + || NULL == (http->hostport = strdup(""))) { return JB_ERR_MEMORY; } @@ -337,8 +337,8 @@ jb_err parse_http_url(const char *url, struct http_request *http, int require_pr freez(buf); - if ( (http->path == NULL) - || (http->hostport == NULL)) + if ((http->path == NULL) + || (http->hostport == NULL)) { return JB_ERR_MEMORY; } @@ -581,7 +581,7 @@ jb_err parse_http_request(const char *req, struct http_request *http) if ( (http->cmd == NULL) || (http->gpc == NULL) - || (http->ver == NULL) ) + || (http->ver == NULL)) { return JB_ERR_MEMORY; } @@ -775,7 +775,7 @@ static jb_err compile_url_pattern(struct url_spec *url, char *buf) * * Function : compile_host_pattern * - * Description : Parses and compiles a host pattern.. + * Description : Parses and compiles a host pattern. * * Parameters : * 1 : url = Target url_spec to be filled in. @@ -841,7 +841,7 @@ static jb_err compile_host_pattern(struct url_spec *url, const char *host_patter */ for (p = url->dbuffer; *p ; p++) { - *p = (char)tolower((int)(unsigned char)*p); + *p = (char)privoxy_tolower(*p); } /* @@ -971,9 +971,9 @@ static int simplematch(const char *pattern, const char *text) /* * Char match, or char range match? */ - if ( (*pat == *txt) - || (*pat == '?') - || ((*pat == ']') && (charmap[*txt / 8] & (1 << (*txt % 8)))) ) + if ((*pat == *txt) + || (*pat == '?') + || ((*pat == ']') && (charmap[*txt / 8] & (1 << (*txt % 8))))) { /* * Success: Go ahead @@ -1009,7 +1009,7 @@ static int simplematch(const char *pattern, const char *text) } /* Cut off extra '*'s */ - if(*pat == '*') pat++; + if (*pat == '*') pat++; /* If this is the pattern's end, fine! */ return(*pat); @@ -1374,7 +1374,7 @@ int match_portlist(const char *portlist, int port) * or, if max was omitted, between min and 65K */ *max++ = '\0'; - if(port >= atoi(min) && port <= (atoi(max) ? atoi(max) : 65535)) + if (port >= atoi(min) && port <= (atoi(max) ? atoi(max) : 65535)) { freez(portlist_copy); return(1);