Fossil SCM

Avoid unnecessary escaping of : characters in URLs in order to make the links more readable.

drh 2013-01-18 02:11 trunk
Commit afec3f814d3dc5b2ad82e14485ae5c9b262d448e
1 file changed +2 -1
+2 -1
--- src/encode.c
+++ src/encode.c
@@ -134,11 +134,12 @@
134134
int count = 0;
135135
char *zOut;
136136
int other;
137137
# define IsSafeChar(X) \
138138
(fossil_isalnum(X) || (X)=='.' || (X)=='$' \
139
- || (X)=='~' || (X)=='-' || (X)=='_' || (X)==other)
139
+ || (X)=='~' || (X)=='-' || (X)=='_' \
140
+ || (!encodeSlash && ((X)=='/' || (X)==':')))
140141
141142
if( zIn==0 ) return 0;
142143
if( n<0 ) n = strlen(zIn);
143144
other = encodeSlash ? 'a' : '/';
144145
while( i<n && (c = zIn[i])!=0 ){
145146
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button