For (internal) usage outside server/util.c, mod_log_forensic for now
and mod_cache (T_HTTP_TOKEN_STOP) in a few...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@
1856490 13f79535-47bb-0310-9956-
ffa450edef68
{
for ( ; *p ; ++p) {
ap_assert(q < e);
- if (test_char_table[*(unsigned char *)p]&T_ESCAPE_FORENSIC) {
+ if (TEST_CHAR(*p, T_ESCAPE_FORENSIC)) {
ap_assert(q+2 < e);
*q++ = '%';
ap_bin2hex(p, 1, q);
printf("0x%03x%c", flags, (c < 255) ? ',' : ' ');
}
- printf("\n};\n");
+ printf("\n};\n\n");
+
+ printf(
+ "/* we assume the folks using this ensure 0 <= c < 256... which means\n"
+ " * you need a cast to (unsigned char) first, you can't just plug a\n"
+ " * char in here and get it to work, because if char is signed then it\n"
+ " * will first be sign extended.\n"
+ " */\n"
+ "#define TEST_CHAR(c, f) (test_char_table[(unsigned char)(c)] & (f))\n"
+ );
return 0;
}
*/
#include "test_char.h"
-/* we assume the folks using this ensure 0 <= c < 256... which means
- * you need a cast to (unsigned char) first, you can't just plug a
- * char in here and get it to work, because if char is signed then it
- * will first be sign extended.
- */
-#define TEST_CHAR(c, f) (test_char_table[(unsigned char)(c)] & (f))
-
/* Win32/NetWare/OS2 need to check for both forward and back slashes
* in ap_getparents() and ap_escape_url.
*/