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

Function lua_ap_strcmp_match

modules/lua/lua_request.c:1707–1725  ·  view source on GitHub ↗

* ap_strcmp_match (const char *str, const char *expected) * Determine if a string matches a pattern containing the wildcards '?' or '*' * @param str The string to check * @param expected The pattern to match against * @param ignoreCase Whether to ignore case when matching * @return 1 if the two strings match, 0 otherwise */

Source from the content-addressed store, hash-verified

1705 * @return 1 if the two strings match, 0 otherwise
1706 */
1707static int lua_ap_strcmp_match(lua_State *L)
1708{
1709 int returnValue;
1710 const char *str;
1711 const char *expected;
1712 int ignoreCase = 0;
1713 luaL_checktype(L, 1, LUA_TSTRING);
1714 str = lua_tostring(L, 1);
1715 luaL_checktype(L, 2, LUA_TSTRING);
1716 expected = lua_tostring(L, 2);
1717 if (lua_isboolean(L, 3))
1718 ignoreCase = lua_toboolean(L, 3);
1719 if (!ignoreCase)
1720 returnValue = ap_strcmp_match(str, expected);
1721 else
1722 returnValue = ap_strcasecmp_match(str, expected);
1723 lua_pushboolean(L, (!returnValue));
1724 return 1;
1725}
1726
1727
1728/**

Callers

nothing calls this directly

Calls 2

ap_strcmp_matchFunction · 0.85
ap_strcasecmp_matchFunction · 0.85

Tested by

no test coverage detected