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

Function decodeenc

modules/proxy/mod_proxy_ftp.c:113–130  ·  view source on GitHub ↗

* Decodes a '%' escaped string, and returns the number of characters */

Source from the content-addressed store, hash-verified

111 * Decodes a '%' escaped string, and returns the number of characters
112 */
113static int decodeenc(char *x)
114{
115 int i, j, ch;
116
117 if (x[0] == '\0')
118 return 0; /* special case for no characters */
119 for (i = 0, j = 0; x[i] != '\0'; i++, j++) {
120 /* decode it if not already done */
121 ch = x[i];
122 if (ch == '%' && apr_isxdigit(x[i + 1]) && apr_isxdigit(x[i + 2])) {
123 ch = ap_proxy_hex2c(&x[i + 1]);
124 i += 2;
125 }
126 x[j] = ch;
127 }
128 x[j] = '\0';
129 return j;
130}
131
132/*
133 * Escape the globbing characters in a path used as argument to

Callers 2

proxy_send_dir_filterFunction · 0.85
proxy_ftp_handlerFunction · 0.85

Calls 1

ap_proxy_hex2cFunction · 0.85

Tested by

no test coverage detected