diff options
author | Nick Mathewson <nickm@torproject.org> | 2009-02-10 21:40:12 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2009-02-10 21:40:12 +0000 |
commit | cd731b77d7e6d0398010ff45bb80e9a3534eaccc (patch) | |
tree | 6034e69ed302be8f83dc7c748999cb64343bccc7 /http.c | |
parent | 1ed27048e4807fe2bf182e9544dc9c7b4741cbc0 (diff) | |
download | libevent-cd731b77d7e6d0398010ff45bb80e9a3534eaccc.tar.gz |
Do not use ctypes functions in cases when we need the "net" locale.
This patch adds a new set of EVUTIL_IS* functions to replace use of
the ctypes is* functions in all cases where we care about characters'
interpretations in net ascii rather than in the locale. For example,
when we're working with DNS hostnames, we don't want to do the 0x20
hack on non-ascii characters, even if the host thinks they should be
isalpha.
svn:r1114
Diffstat (limited to 'http.c')
-rw-r--r-- | http.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -63,7 +63,6 @@ #endif #include <assert.h> -#include <ctype.h> #include <errno.h> #include <stdio.h> #include <stdlib.h> @@ -2125,8 +2124,8 @@ evhttp_decode_uri_internal(const char *uri, size_t length, char *ret) in_query = 1; } else if (c == '+' && in_query) { c = ' '; - } else if (c == '%' && isxdigit((unsigned char)uri[i+1]) && - isxdigit((unsigned char)uri[i+2])) { + } else if (c == '%' && EVUTIL_ISXDIGIT(uri[i+1]) && + EVUTIL_ISXDIGIT(uri[i+2])) { char tmp[] = { uri[i+1], uri[i+2], '\0' }; c = (char)strtol(tmp, NULL, 16); i += 2; @@ -2254,7 +2253,7 @@ prefix_suffix_match(const char *pattern, const char *name, int ignorecase) default: if (c != *name) { if (!ignorecase || - tolower(c) != tolower(*name)) + EVUTIL_TOLOWER(c) != EVUTIL_TOLOWER(*name)) return (0); } ++name; |