diff options
author | erdgeist <> | 2007-01-11 01:06:10 +0000 |
---|---|---|
committer | erdgeist <> | 2007-01-11 01:06:10 +0000 |
commit | 805e46450cfa9400e30fd124c893dda18e050f2b (patch) | |
tree | 10a4992132ed6efe7c5feaa6fdfe84116f10e7e6 /scan_urlencoded_query.c | |
parent | cb12e922d5ee1438e47c9510db6748f91f70976e (diff) |
Documentation improved, some reindenting (again), variable types checked, unnecessary defines removed
Diffstat (limited to 'scan_urlencoded_query.c')
-rw-r--r-- | scan_urlencoded_query.c | 16 |
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 | */ | |
14 | static const unsigned char reserved_matrix[] = { 0xA2, 0x63, 0xFF, 0x03, 0xFE, 0xFF, 0xFF, 0x87, 0xFE, 0xFF, 0xFF, 0x47}; | 14 | static const unsigned char reserved_matrix[] = { 0xA2, 0x63, 0xFF, 0x03, 0xFE, 0xFF, 0xFF, 0x87, 0xFE, 0xFF, 0xFF, 0x47}; |
15 | inline int is_unreserved( unsigned char c ) { | 15 | static 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 | ||