summaryrefslogtreecommitdiffstats
path: root/Source/CTest/Curl/escape.c
diff options
context:
space:
mode:
Diffstat (limited to 'Source/CTest/Curl/escape.c')
-rw-r--r--Source/CTest/Curl/escape.c40
1 files changed, 17 insertions, 23 deletions
diff --git a/Source/CTest/Curl/escape.c b/Source/CTest/Curl/escape.c
index 88f4359..0ec7ae5 100644
--- a/Source/CTest/Curl/escape.c
+++ b/Source/CTest/Curl/escape.c
@@ -1,25 +1,25 @@
-/*****************************************************************************
+/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
- *
- * In order to be useful for every potential user, curl and libcurl are
- * dual-licensed under the MPL and the MIT/X-derivate licenses.
+ * Copyright (C) 1998 - 2002, Daniel Stenberg, <daniel@haxx.se>, et al.
*
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at http://curl.haxx.se/docs/copyright.html.
+ *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
- * furnished to do so, under the terms of the MPL or the MIT/X-derivate
- * licenses. You may pick one of these licenses.
+ * furnished to do so, under the terms of the COPYING file.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
* $Id$
- *****************************************************************************/
+ ***************************************************************************/
/* Escape and unescape URL encoding in strings. The functions return a new
* allocated string or NULL if an error occurred. */
@@ -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;
@@ -111,6 +100,11 @@ char *curl_unescape(const char *string, int length)
}
+void curl_free(void *p)
+{
+ free(p);
+}
+
/*
* local variables:
* eval: (load-file "../curl-mode.el")