Fossil SCM
Allow ~ and % characters in the URL. Ticket [74ccf51c7d24414b1].
Commit
a203674aa54063b166fe5999dd55c0443ed3f717
Parent
8d864a7f65adbe8…
2 files changed
+2
-1
+1
-1
+2
-1
| --- src/encode.c | ||
| +++ src/encode.c | ||
| @@ -100,11 +100,12 @@ | ||
| 100 | 100 | int i = 0; |
| 101 | 101 | int count = 0; |
| 102 | 102 | char *zOut; |
| 103 | 103 | int other; |
| 104 | 104 | # define IsSafeChar(X) \ |
| 105 | - (isalnum(X) || (X)=='.' || (X)=='$' || (X)=='-' || (X)=='_' || (X)==other) | |
| 105 | + (isalnum(X) || (X)=='.' || (X)=='$' \ | |
| 106 | + || (X)=='~' || (X)=='-' || (X)=='_' || (X)==other) | |
| 106 | 107 | |
| 107 | 108 | if( zIn==0 ) return 0; |
| 108 | 109 | if( n<0 ) n = strlen(zIn); |
| 109 | 110 | other = encodeSlash ? 'a' : '/'; |
| 110 | 111 | while( i<n && (c = zIn[i])!=0 ){ |
| 111 | 112 |
| --- src/encode.c | |
| +++ src/encode.c | |
| @@ -100,11 +100,12 @@ | |
| 100 | int i = 0; |
| 101 | int count = 0; |
| 102 | char *zOut; |
| 103 | int other; |
| 104 | # define IsSafeChar(X) \ |
| 105 | (isalnum(X) || (X)=='.' || (X)=='$' || (X)=='-' || (X)=='_' || (X)==other) |
| 106 | |
| 107 | if( zIn==0 ) return 0; |
| 108 | if( n<0 ) n = strlen(zIn); |
| 109 | other = encodeSlash ? 'a' : '/'; |
| 110 | while( i<n && (c = zIn[i])!=0 ){ |
| 111 |
| --- src/encode.c | |
| +++ src/encode.c | |
| @@ -100,11 +100,12 @@ | |
| 100 | int i = 0; |
| 101 | int count = 0; |
| 102 | char *zOut; |
| 103 | int other; |
| 104 | # define IsSafeChar(X) \ |
| 105 | (isalnum(X) || (X)=='.' || (X)=='$' \ |
| 106 | || (X)=='~' || (X)=='-' || (X)=='_' || (X)==other) |
| 107 | |
| 108 | if( zIn==0 ) return 0; |
| 109 | if( n<0 ) n = strlen(zIn); |
| 110 | other = encodeSlash ? 'a' : '/'; |
| 111 | while( i<n && (c = zIn[i])!=0 ){ |
| 112 |
+1
-1
| --- src/url.c | ||
| +++ src/url.c | ||
| @@ -119,11 +119,11 @@ | ||
| 119 | 119 | }else{ |
| 120 | 120 | g.urlPort = g.urlDfltPort; |
| 121 | 121 | g.urlHostname = g.urlName; |
| 122 | 122 | } |
| 123 | 123 | dehttpize(g.urlName); |
| 124 | - g.urlPath = mprintf(&zUrl[i]); | |
| 124 | + g.urlPath = mprintf("%s", &zUrl[i]); | |
| 125 | 125 | for(i=0; g.urlPath[i] && g.urlPath[i]!='?'; i++){} |
| 126 | 126 | if( g.urlPath[i] ){ |
| 127 | 127 | g.urlPath[i] = 0; |
| 128 | 128 | i++; |
| 129 | 129 | } |
| 130 | 130 |
| --- src/url.c | |
| +++ src/url.c | |
| @@ -119,11 +119,11 @@ | |
| 119 | }else{ |
| 120 | g.urlPort = g.urlDfltPort; |
| 121 | g.urlHostname = g.urlName; |
| 122 | } |
| 123 | dehttpize(g.urlName); |
| 124 | g.urlPath = mprintf(&zUrl[i]); |
| 125 | for(i=0; g.urlPath[i] && g.urlPath[i]!='?'; i++){} |
| 126 | if( g.urlPath[i] ){ |
| 127 | g.urlPath[i] = 0; |
| 128 | i++; |
| 129 | } |
| 130 |
| --- src/url.c | |
| +++ src/url.c | |
| @@ -119,11 +119,11 @@ | |
| 119 | }else{ |
| 120 | g.urlPort = g.urlDfltPort; |
| 121 | g.urlHostname = g.urlName; |
| 122 | } |
| 123 | dehttpize(g.urlName); |
| 124 | g.urlPath = mprintf("%s", &zUrl[i]); |
| 125 | for(i=0; g.urlPath[i] && g.urlPath[i]!='?'; i++){} |
| 126 | if( g.urlPath[i] ){ |
| 127 | g.urlPath[i] = 0; |
| 128 | i++; |
| 129 | } |
| 130 |