-const char urlmatch_rcs[] = "$Id: urlmatch.c,v 1.68 2012/03/09 16:23:50 fabiankeil Exp $";
+const char urlmatch_rcs[] = "$Id: urlmatch.c,v 1.71 2012/06/08 15:15:11 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/urlmatch.c,v $
}
/* split the domain name into components */
- http->dcount = ssplit(http->dbuffer, ".", vec, SZ(vec), 1, 1);
+ http->dcount = ssplit(http->dbuffer, ".", vec, SZ(vec));
if (http->dcount <= 0)
{
/* save a copy of the pointers in dvec */
size = (size_t)http->dcount * sizeof(*http->dvec);
- http->dvec = (char **)malloc(size);
- if (NULL == http->dvec)
- {
- return JB_ERR_MEMORY;
- }
+ http->dvec = malloc_or_die(size);
memcpy(http->dvec, vec, size);
*/
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;
}
freez(buf);
if ((http->path == NULL)
- || (http->hostport == NULL))
+ || (http->hostport == NULL))
{
return JB_ERR_MEMORY;
}
return JB_ERR_MEMORY;
}
- n = ssplit(buf, " \r\n", v, SZ(v), 1, 1);
+ n = ssplit(buf, " \r\n", v, SZ(v));
if (n != 3)
{
freez(buf);
freez(buf);
- if ((http->cmd == NULL)
+ if ( (http->cmd == NULL)
|| (http->gpc == NULL)
|| (http->ver == NULL))
{
/*
* Split the domain name into components
*/
- url->dcount = ssplit(url->dbuffer, ".", v, SZ(v), 1, 1);
+ url->dcount = ssplit(url->dbuffer, ".", v, SZ(v));
if (url->dcount < 0)
{
*/
size = (size_t)url->dcount * sizeof(*url->dvec);
- url->dvec = (char **)malloc(size);
- if (NULL == url->dvec)
- {
- free_url_spec(url);
- return JB_ERR_MEMORY;
- }
+ url->dvec = malloc_or_die(size);
memcpy(url->dvec, v, size);
}
* Char match, or char range match?
*/
if ((*pat == *txt)
- || (*pat == '?')
- || ((*pat == ']') && (charmap[*txt / 8] & (1 << (*txt % 8)))))
+ || (*pat == '?')
+ || ((*pat == ']') && (charmap[*txt / 8] & (1 << (*txt % 8)))))
{
/*
* Success: Go ahead
}
/* Cut off extra '*'s */
- if (*pat == '*') pat++;
+ if (*pat == '*') pat++;
/* If this is the pattern's end, fine! */
return(*pat);