/[jscoverage]/trunk/http-url.c
ViewVC logotype

Diff of /trunk/http-url.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 427 by siliconforks, Wed Feb 18 16:08:33 2009 UTC revision 456 by siliconforks, Tue Sep 8 17:09:28 2009 UTC
# Line 85  Line 85 
85  int URL_parse(const char * url, char ** host, uint16_t * port, char ** abs_path, char ** query) {  int URL_parse(const char * url, char ** host, uint16_t * port, char ** abs_path, char ** query) {
86    /* check for invalid characters */    /* check for invalid characters */
87    for (const char * p = url; *p != '\0'; p++) {    for (const char * p = url; *p != '\0'; p++) {
88      switch (*p) {      if (*p <= 32 || *p >= 127) {
89      case ';':        return -1;
     case '/':  
     case '?':  
     case ':':  
     case '@':  
     case '&':  
     case '=':  
     case '+':  
     case '$':  
     case ',':  
     case '-':  
     case '_':  
     case '.':  
     case '!':  
     case '~':  
     case '*':  
     case '\'':  
     case '(':  
     case ')':  
     case '%':  
       break;  
     default:  
       if (! isalnum(*p)) {  
         return -1;  
       }  
       break;  
90      }      }
91    }    }
92    

Legend:
Removed from v.427  
changed lines
  Added in v.456

  ViewVC Help
Powered by ViewVC 1.1.24