| 2071 | } |
| 2072 | |
| 2073 | AP_DECLARE(char *) ap_os_escape_path(apr_pool_t *p, const char *path, int partial) |
| 2074 | { |
| 2075 | char *copy = apr_palloc(p, 3 * strlen(path) + 3); |
| 2076 | const unsigned char *s = (const unsigned char *)path; |
| 2077 | unsigned char *d = (unsigned char *)copy; |
| 2078 | unsigned c; |
| 2079 | |
| 2080 | if (!partial) { |
| 2081 | const char *colon = ap_strchr_c(path, ':'); |
| 2082 | const char *slash = ap_strchr_c(path, '/'); |
| 2083 | |
| 2084 | if (colon && (!slash || colon < slash)) { |
| 2085 | *d++ = '.'; |
| 2086 | *d++ = '/'; |
| 2087 | } |
| 2088 | } |
| 2089 | while ((c = *s)) { |
| 2090 | if (TEST_CHAR(c, T_OS_ESCAPE_PATH)) { |
| 2091 | d = c2x(c, '%', d); |
| 2092 | } |
| 2093 | else { |
| 2094 | *d++ = c; |
| 2095 | } |
| 2096 | ++s; |
| 2097 | } |
| 2098 | *d = '\0'; |
| 2099 | return copy; |
| 2100 | } |
| 2101 | |
| 2102 | AP_DECLARE(char *) ap_escape_urlencoded_buffer(char *copy, const char *buffer) |
| 2103 | { |
no test coverage detected