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

Function lua_ap_os_escape_path

modules/lua/lua_request.c:1660–1675  ·  view source on GitHub ↗

* ap_os_escape_path (apr_pool_t *p, const char *path, int partial) * convert an OS path to a URL in an OS dependant way. * @param p The pool to allocate from * @param path The path to convert * @param partial if set, assume that the path will be appended to something * with a '/' in it (and thus does not prefix "./") * @return The converted URL */

Source from the content-addressed store, hash-verified

1658 * @return The converted URL
1659 */
1660static int lua_ap_os_escape_path(lua_State *L)
1661{
1662 char *returnValue;
1663 request_rec *r;
1664 const char *path;
1665 int partial = 0;
1666 luaL_checktype(L, 1, LUA_TUSERDATA);
1667 r = ap_lua_check_request_rec(L, 1);
1668 luaL_checktype(L, 2, LUA_TSTRING);
1669 path = lua_tostring(L, 2);
1670 if (lua_isboolean(L, 3))
1671 partial = lua_toboolean(L, 3);
1672 returnValue = ap_os_escape_path(r->pool, path, partial);
1673 lua_pushstring(L, returnValue);
1674 return 1;
1675}
1676
1677
1678/**

Callers

nothing calls this directly

Calls 2

ap_os_escape_pathFunction · 0.85
ap_lua_check_request_recFunction · 0.70

Tested by

no test coverage detected