Commit 29f5ae1a authored by Yann Ylavic's avatar Yann Ylavic
Browse files

Provide TEST_CHAR marco in test_char.h

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
parent c972e3f8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -123,7 +123,7 @@ static char *log_escape(char *q, const char *e, const char *p)
{
    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);
+10 −1
Original line number Diff line number Diff line
@@ -167,7 +167,16 @@ int main(int argc, char *argv[])
        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;
}
+0 −7
Original line number Diff line number Diff line
@@ -76,13 +76,6 @@
 */
#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.
 */