Fossil SCM
Avoid unnecessary escaping of : characters in URLs in order to make the links more readable.
Commit
afec3f814d3dc5b2ad82e14485ae5c9b262d448e
Parent
6bb63a736493d0d…
1 file changed
+2
-1
+2
-1
| --- src/encode.c | ||
| +++ src/encode.c | ||
| @@ -134,11 +134,12 @@ | ||
| 134 | 134 | int count = 0; |
| 135 | 135 | char *zOut; |
| 136 | 136 | int other; |
| 137 | 137 | # define IsSafeChar(X) \ |
| 138 | 138 | (fossil_isalnum(X) || (X)=='.' || (X)=='$' \ |
| 139 | - || (X)=='~' || (X)=='-' || (X)=='_' || (X)==other) | |
| 139 | + || (X)=='~' || (X)=='-' || (X)=='_' \ | |
| 140 | + || (!encodeSlash && ((X)=='/' || (X)==':'))) | |
| 140 | 141 | |
| 141 | 142 | if( zIn==0 ) return 0; |
| 142 | 143 | if( n<0 ) n = strlen(zIn); |
| 143 | 144 | other = encodeSlash ? 'a' : '/'; |
| 144 | 145 | while( i<n && (c = zIn[i])!=0 ){ |
| 145 | 146 |
| --- src/encode.c | |
| +++ src/encode.c | |
| @@ -134,11 +134,12 @@ | |
| 134 | int count = 0; |
| 135 | char *zOut; |
| 136 | int other; |
| 137 | # define IsSafeChar(X) \ |
| 138 | (fossil_isalnum(X) || (X)=='.' || (X)=='$' \ |
| 139 | || (X)=='~' || (X)=='-' || (X)=='_' || (X)==other) |
| 140 | |
| 141 | if( zIn==0 ) return 0; |
| 142 | if( n<0 ) n = strlen(zIn); |
| 143 | other = encodeSlash ? 'a' : '/'; |
| 144 | while( i<n && (c = zIn[i])!=0 ){ |
| 145 |
| --- src/encode.c | |
| +++ src/encode.c | |
| @@ -134,11 +134,12 @@ | |
| 134 | int count = 0; |
| 135 | char *zOut; |
| 136 | int other; |
| 137 | # define IsSafeChar(X) \ |
| 138 | (fossil_isalnum(X) || (X)=='.' || (X)=='$' \ |
| 139 | || (X)=='~' || (X)=='-' || (X)=='_' \ |
| 140 | || (!encodeSlash && ((X)=='/' || (X)==':'))) |
| 141 | |
| 142 | if( zIn==0 ) return 0; |
| 143 | if( n<0 ) n = strlen(zIn); |
| 144 | other = encodeSlash ? 'a' : '/'; |
| 145 | while( i<n && (c = zIn[i])!=0 ){ |
| 146 |