MCPcopy Create free account
hub / github.com/apache/httpd / find_last_token

Function find_last_token

server/util.c:1758–1778  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1756}
1757
1758static const char *find_last_token(apr_pool_t *p, const char *line,
1759 const char *tok)
1760{
1761 int llen, tlen, lidx;
1762
1763 if (!line)
1764 return NULL;
1765
1766 llen = strlen(line);
1767 tlen = strlen(tok);
1768 lidx = llen - tlen;
1769
1770 if (lidx < 0 ||
1771 (lidx > 0 && !(apr_isspace(line[lidx - 1]) || line[lidx - 1] == ',')))
1772 return NULL;
1773
1774 if (ap_cstr_casecmpn(&line[lidx], tok, tlen) == 0) {
1775 return &line[lidx];
1776 }
1777 return NULL;
1778}
1779
1780AP_DECLARE(int) ap_find_last_token(apr_pool_t *p, const char *line,
1781 const char *tok)

Callers 2

ap_find_last_tokenFunction · 0.85
ap_is_chunkedFunction · 0.85

Calls 1

ap_cstr_casecmpnFunction · 0.85

Tested by

no test coverage detected