Commit 2827f532 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

curl_escape() no longer attempts to detect already encoded stuff (in order

not to re-encode it).
parent 47bb09e9
Loading
Loading
Loading
Loading
+7 −20
Original line number Diff line number Diff line
@@ -54,19 +54,6 @@ char *curl_escape(char *string, int length)
            !(in >= 'A' && in <= 'Z') &&
            !(in >= '0' && in <= '9')) {
      /* encode it */
      if(('%' == in) &&
         (length>=2) &&
         isxdigit((int)string[1]) &&
         isxdigit((int)string[2]) ) {
        /*
         * This is an already encoded letter, leave it!
         */
        memcpy(&ns[index], string, 3);
        string+=2;
      }
      else {
        /* encode this now */

      newlen += 2; /* the size grows with two, since this'll become a %XX */
      if(newlen > alloc) {
        alloc *= 2;
@@ -75,7 +62,7 @@ char *curl_escape(char *string, int length)
          return NULL;
      }
      sprintf(&ns[index], "%%%02X", in);
      }

      index+=3;
    }
    else {