From 805e46450cfa9400e30fd124c893dda18e050f2b Mon Sep 17 00:00:00 2001 From: erdgeist <> Date: Thu, 11 Jan 2007 01:06:10 +0000 Subject: Documentation improved, some reindenting (again), variable types checked, unnecessary defines removed --- scan_urlencoded_query.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'scan_urlencoded_query.c') 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 @@ #include "scan.h" #include "scan_urlencoded_query.h" -// Idea is to do a in place replacement or guarantee at least -// strlen( string ) bytes in deststring -// watch http://www.ietf.org/rfc/rfc2396.txt -// unreserved = alphanum | mark -// mark = "-" | "_" | "." | "!" | "~" | "*" | "'" | "(" | ")" -// we add '%' to the matrix to not stop at encoded chars. - +/* Idea is to do a in place replacement or guarantee at least + strlen( string ) bytes in deststring + watch http://www.ietf.org/rfc/rfc2396.txt + unreserved = alphanum | mark + mark = "-" | "_" | "." | "!" | "~" | "*" | "'" | "(" | ")" + we add '%' to the matrix to not stop at encoded chars. +*/ static const unsigned char reserved_matrix[] = { 0xA2, 0x63, 0xFF, 0x03, 0xFE, 0xFF, 0xFF, 0x87, 0xFE, 0xFF, 0xFF, 0x47}; -inline int is_unreserved( unsigned char c ) { +static int is_unreserved( unsigned char c ) { if( ( c <= 32 ) || ( c >= 127 ) ) return 0; return 1&(reserved_matrix[(c-32)>>3]>>(c&7)); } -- cgit v1.2.3