~ubuntu-branches/ubuntu/saucy/curl/saucy-201307251546

« back to all changes in this revision

Viewing changes to lib/escape.c

  • Committer: Bazaar Package Importer
  • Author(s): Ramakrishnan Muthukrishnan
  • Date: 2010-10-18 11:13:17 UTC
  • mto: (3.6.1 experimental) (1.3.1)
  • mto: This revision was merged to the branch mainline in revision 44.
  • Revision ID: james.westby@ubuntu.com-20101018111317-9rkas34ecwtq0upn
Tags: upstream-7.21.2
ImportĀ upstreamĀ versionĀ 7.21.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
#include "memdebug.h"
44
44
 
45
45
/* Portable character check (remember EBCDIC). Do not use isalnum() because
46
 
its behavior is altered by the current locale. */
47
 
static bool Curl_isalnum(unsigned char in)
 
46
   its behavior is altered by the current locale.
 
47
   See http://tools.ietf.org/html/rfc3986#section-2.3
 
48
*/
 
49
static bool Curl_isunreserved(unsigned char in)
48
50
{
49
51
  switch (in) {
50
52
    case '0': case '1': case '2': case '3': case '4':
59
61
    case 'K': case 'L': case 'M': case 'N': case 'O':
60
62
    case 'P': case 'Q': case 'R': case 'S': case 'T':
61
63
    case 'U': case 'V': case 'W': case 'X': case 'Y': case 'Z':
 
64
    case '-': case '.': case '_': case '~':
62
65
      return TRUE;
63
66
    default:
64
67
      break;
100
103
  while(length--) {
101
104
    in = *string;
102
105
 
103
 
    if (Curl_isalnum(in)) {
 
106
    if (Curl_isunreserved(in)) {
104
107
      /* just copy this */
105
108
      ns[strindex++]=in;
106
109
    }