Fossil

Diff
Login

Differences From Artifact [25c283fc02]:

To Artifact [42bb27dd9e]:


132
133
134
135
136
137
138
139


140
141
142
143
144
145
146
132
133
134
135
136
137
138

139
140
141
142
143
144
145
146
147







-
+
+







  int c;
  int i = 0;
  int count = 0;
  char *zOut;
  int other;
# define IsSafeChar(X)  \
     (fossil_isalnum(X) || (X)=='.' || (X)=='$' \
      || (X)=='~' || (X)=='-' || (X)=='_' || (X)==other)
      || (X)=='~' || (X)=='-' || (X)=='_' \
      || (!encodeSlash && ((X)=='/' || (X)==':')))

  if( zIn==0 ) return 0;
  if( n<0 ) n = strlen(zIn);
  other = encodeSlash ? 'a' : '/';
  while( i<n && (c = zIn[i])!=0 ){
    if( IsSafeChar(c) || c==' ' ){
      count++;