Fossil SCM

Allow ~ and % characters in the URL. Ticket [74ccf51c7d24414b1].

drh 2010-09-09 09:59 trunk
Commit a203674aa54063b166fe5999dd55c0443ed3f717
2 files changed +2 -1 +1 -1
+2 -1
--- src/encode.c
+++ src/encode.c
@@ -100,11 +100,12 @@
100100
int i = 0;
101101
int count = 0;
102102
char *zOut;
103103
int other;
104104
# define IsSafeChar(X) \
105
- (isalnum(X) || (X)=='.' || (X)=='$' || (X)=='-' || (X)=='_' || (X)==other)
105
+ (isalnum(X) || (X)=='.' || (X)=='$' \
106
+ || (X)=='~' || (X)=='-' || (X)=='_' || (X)==other)
106107
107108
if( zIn==0 ) return 0;
108109
if( n<0 ) n = strlen(zIn);
109110
other = encodeSlash ? 'a' : '/';
110111
while( i<n && (c = zIn[i])!=0 ){
111112
--- 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 @@
119119
}else{
120120
g.urlPort = g.urlDfltPort;
121121
g.urlHostname = g.urlName;
122122
}
123123
dehttpize(g.urlName);
124
- g.urlPath = mprintf(&zUrl[i]);
124
+ g.urlPath = mprintf("%s", &zUrl[i]);
125125
for(i=0; g.urlPath[i] && g.urlPath[i]!='?'; i++){}
126126
if( g.urlPath[i] ){
127127
g.urlPath[i] = 0;
128128
i++;
129129
}
130130
--- 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

Keyboard Shortcuts

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