aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2002-06-26 07:15:31 +0000
committerDaniel Stenberg <daniel@haxx.se>2002-06-26 07:15:31 +0000
commit2f8e7f56b32f7ccf6c5f18a310d170289dfd4e1c (patch)
treeb8f202879b05f50de04f71c592adf9ee42d8e2a2 /lib
parent2443e1f38c38c4fe2611e330990dfe6296da19aa (diff)
ignore '+' in URLs, generate only %-codes
Diffstat (limited to 'lib')
-rw-r--r--lib/escape.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/lib/escape.c b/lib/escape.c
index f798327a8..15ce3e3fa 100644
--- a/lib/escape.c
+++ b/lib/escape.c
@@ -48,11 +48,9 @@ char *curl_escape(const char *string, int length)
length = alloc-1;
while(length--) {
in = *string;
- if(' ' == in)
- ns[index++] = '+';
- else if(!(in >= 'a' && in <= 'z') &&
- !(in >= 'A' && in <= 'Z') &&
- !(in >= '0' && in <= '9')) {
+ if(!(in >= 'a' && in <= 'z') &&
+ !(in >= 'A' && in <= 'Z') &&
+ !(in >= '0' && in <= '9')) {
/* encode it */
newlen += 2; /* the size grows with two, since this'll become a %XX */
if(newlen > alloc) {
@@ -82,19 +80,10 @@ char *curl_unescape(const char *string, int length)
unsigned char in;
int index=0;
unsigned 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 > 0) {
in = *string;
- if(querypart && ('+' == in))
- in = ' ';
- else if(!querypart && ('?' == in)) {
- /* we have "walked in" to the query part */
- querypart=TRUE;
- }
- else if('%' == in) {
+ if('%' == in) {
/* encoded part */
if(sscanf(string+1, "%02X", &hex)) {
in = hex;