Loading lib/escape.c +17 −7 Original line number Diff line number Diff line Loading @@ -41,6 +41,9 @@ /* Escape and unescape URL encoding in strings. The functions return a new * allocated string or NULL if an error occurred. */ #include "setup.h" #include <curl/curl.h> #include <stdio.h> #include <stdlib.h> #include <string.h> Loading Loading @@ -88,11 +91,18 @@ char *curl_unescape(char *string, int length) unsigned char in; int index=0; int hex; char querypart=FALSE; /* everything to the right of a '?' letter is the "query part" where '+' should become ' '. RFC 2316, section 3.10 */ while(--alloc) { in = *string; if('+' == in) if(querypart && ('+' == in)) in = ' '; else if(!querypart && ('?' == in)) { /* we have "walked in" to the query part */ querypart=TRUE; } else if('%' == in) { /* encoded part */ if(sscanf(string+1, "%02X", &hex)) { Loading Loading
lib/escape.c +17 −7 Original line number Diff line number Diff line Loading @@ -41,6 +41,9 @@ /* Escape and unescape URL encoding in strings. The functions return a new * allocated string or NULL if an error occurred. */ #include "setup.h" #include <curl/curl.h> #include <stdio.h> #include <stdlib.h> #include <string.h> Loading Loading @@ -88,11 +91,18 @@ char *curl_unescape(char *string, int length) unsigned char in; int index=0; int hex; char querypart=FALSE; /* everything to the right of a '?' letter is the "query part" where '+' should become ' '. RFC 2316, section 3.10 */ while(--alloc) { in = *string; if('+' == in) if(querypart && ('+' == in)) in = ' '; else if(!querypart && ('?' == in)) { /* we have "walked in" to the query part */ querypart=TRUE; } else if('%' == in) { /* encoded part */ if(sscanf(string+1, "%02X", &hex)) { Loading