summaryrefslogtreecommitdiff
path: root/scan_urlencoded_query.c
diff options
context:
space:
mode:
Diffstat (limited to 'scan_urlencoded_query.c')
-rw-r--r--scan_urlencoded_query.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/scan_urlencoded_query.c b/scan_urlencoded_query.c
index ec145f9..223a4ad 100644
--- a/scan_urlencoded_query.c
+++ b/scan_urlencoded_query.c
@@ -4,15 +4,15 @@
4#include "scan.h" 4#include "scan.h"
5#include "scan_urlencoded_query.h" 5#include "scan_urlencoded_query.h"
6 6
7// Idea is to do a in place replacement or guarantee at least 7/* Idea is to do a in place replacement or guarantee at least
8// strlen( string ) bytes in deststring 8 strlen( string ) bytes in deststring
9// watch http://www.ietf.org/rfc/rfc2396.txt 9 watch http://www.ietf.org/rfc/rfc2396.txt
10// unreserved = alphanum | mark 10 unreserved = alphanum | mark
11// mark = "-" | "_" | "." | "!" | "~" | "*" | "'" | "(" | ")" 11 mark = "-" | "_" | "." | "!" | "~" | "*" | "'" | "(" | ")"
12// we add '%' to the matrix to not stop at encoded chars. 12 we add '%' to the matrix to not stop at encoded chars.
13 13*/
14static const unsigned char reserved_matrix[] = { 0xA2, 0x63, 0xFF, 0x03, 0xFE, 0xFF, 0xFF, 0x87, 0xFE, 0xFF, 0xFF, 0x47}; 14static const unsigned char reserved_matrix[] = { 0xA2, 0x63, 0xFF, 0x03, 0xFE, 0xFF, 0xFF, 0x87, 0xFE, 0xFF, 0xFF, 0x47};
15inline int is_unreserved( unsigned char c ) { 15static int is_unreserved( unsigned char c ) {
16 if( ( c <= 32 ) || ( c >= 127 ) ) return 0; return 1&(reserved_matrix[(c-32)>>3]>>(c&7)); 16 if( ( c <= 32 ) || ( c >= 127 ) ) return 0; return 1&(reserved_matrix[(c-32)>>3]>>(c&7));
17} 17}
18 18