Lines Matching refs:i

58 static int burl_normalize_basic_unreserved_fix (buffer *b, buffer *t, int i, int qs)  in burl_normalize_basic_unreserved_fix()  argument
60 int j = i; in burl_normalize_basic_unreserved_fix()
64 (unsigned char *)buffer_string_prepare_copy(t,i+(used-i)*3+1); in burl_normalize_basic_unreserved_fix()
66 memcpy(p, s, (size_t)i); in burl_normalize_basic_unreserved_fix()
67 for (; i < used; ++i, ++j) { in burl_normalize_basic_unreserved_fix()
68 if (!encoded_chars_http_uri_reqd[s[i]]) { in burl_normalize_basic_unreserved_fix()
69 p[j] = s[i]; in burl_normalize_basic_unreserved_fix()
70 if (__builtin_expect( (s[i] == '?'), 0) && -1 == qs) qs = j; in burl_normalize_basic_unreserved_fix()
72 else if (s[i]=='%' && li_cton(s[i+1], n1) && li_cton(s[i+2], n2)) { in burl_normalize_basic_unreserved_fix()
83 i+=2; in burl_normalize_basic_unreserved_fix()
85 else if (s[i] == '#') break; /* ignore fragment */ in burl_normalize_basic_unreserved_fix()
88 p[++j] = hex_chars_uc[(s[i] >> 4) & 0xF]; in burl_normalize_basic_unreserved_fix()
89 p[++j] = hex_chars_uc[s[i] & 0xF]; in burl_normalize_basic_unreserved_fix()
90 if (li_utf8_invalid_byte(s[i])) qs = -2; in burl_normalize_basic_unreserved_fix()
105 for (int i = 0; i < used; ++i) { in burl_normalize_basic_unreserved() local
106 if (!encoded_chars_http_uri_reqd[s[i]]) { in burl_normalize_basic_unreserved()
107 if (__builtin_expect( (s[i] == '?'), 0) && -1 == qs) qs = i; in burl_normalize_basic_unreserved()
109 else if (s[i]=='%' && li_cton(s[i+1], n1) && li_cton(s[i+2], n2) in burl_normalize_basic_unreserved()
112 if (s[i+1] >= 'a') b->ptr[i+1] &= 0xdf; /* uppercase hex */ in burl_normalize_basic_unreserved()
113 if (s[i+2] >= 'a') b->ptr[i+2] &= 0xdf; /* uppercase hex */ in burl_normalize_basic_unreserved()
114 i+=2; in burl_normalize_basic_unreserved()
116 else if (s[i] == '#') { /* ignore fragment */ in burl_normalize_basic_unreserved()
117 buffer_truncate(b, (size_t)i); in burl_normalize_basic_unreserved()
121 qs = burl_normalize_basic_unreserved_fix(b, t, i, qs); in burl_normalize_basic_unreserved()
130 static int burl_normalize_basic_required_fix (buffer *b, buffer *t, int i, int qs) in burl_normalize_basic_required_fix() argument
132 int j = i; in burl_normalize_basic_required_fix()
136 (unsigned char *)buffer_string_prepare_copy(t,i+(used-i)*3+1); in burl_normalize_basic_required_fix()
139 memcpy(p, s, (size_t)i); in burl_normalize_basic_required_fix()
140 for (; i < used; ++i, ++j) { in burl_normalize_basic_required_fix()
141 if (!encoded_chars_http_uri_reqd[s[i]]) { in burl_normalize_basic_required_fix()
142 p[j] = s[i]; in burl_normalize_basic_required_fix()
143 if (__builtin_expect( (s[i] == '?'), 0)) qs = j; in burl_normalize_basic_required_fix()
145 else if (s[i]=='%' && li_cton(s[i+1], n1) && li_cton(s[i+2], n2)) { in burl_normalize_basic_required_fix()
159 i+=2; in burl_normalize_basic_required_fix()
161 else if (s[i] == '#') break; /* ignore fragment */ in burl_normalize_basic_required_fix()
164 p[++j] = hex_chars_uc[(s[i] >> 4) & 0xF]; in burl_normalize_basic_required_fix()
165 p[++j] = hex_chars_uc[s[i] & 0xF]; in burl_normalize_basic_required_fix()
166 invalid_utf8 |= li_utf8_invalid_byte(s[i]); in burl_normalize_basic_required_fix()
182 for (int i = 0; i < used; ++i) { in burl_normalize_basic_required() local
183 if (!encoded_chars_http_uri_reqd[s[i]]) { in burl_normalize_basic_required()
184 if (s[i] == '?') qs = i; in burl_normalize_basic_required()
186 else if (s[i]=='%' && li_cton(s[i+1], n1) && li_cton(s[i+2], n2) in burl_normalize_basic_required()
192 if (s[i+1] >= 'a') b->ptr[i+1] &= 0xdf; /* uppercase hex */ in burl_normalize_basic_required()
193 if (s[i+2] >= 'a') b->ptr[i+2] &= 0xdf; /* uppercase hex */ in burl_normalize_basic_required()
194 i+=2; in burl_normalize_basic_required()
196 else if (s[i] == '#') { /* ignore fragment */ in burl_normalize_basic_required()
197 buffer_truncate(b, (size_t)i); in burl_normalize_basic_required()
201 qs = burl_normalize_basic_required_fix(b, t, i, qs); in burl_normalize_basic_required()
214 for (int i = 0; i < used; ++i) { in burl_contains_ctrls() local
215 if (s[i] == '%' && (s[i+1] < '2' || (s[i+1] == '7' && s[i+2] == 'F'))) in burl_contains_ctrls()
222 static void burl_normalize_qs20_to_plus_fix (buffer *b, int i) in burl_normalize_qs20_to_plus_fix() argument
226 int j = i; in burl_normalize_qs20_to_plus_fix()
227 for (; i < used; ++i, ++j) { in burl_normalize_qs20_to_plus_fix()
228 s[j] = s[i]; in burl_normalize_qs20_to_plus_fix()
229 if (s[i] == '%' && s[i+1] == '2' && s[i+2] == '0') { in burl_normalize_qs20_to_plus_fix()
231 i+=2; in burl_normalize_qs20_to_plus_fix()
242 int i; in burl_normalize_qs20_to_plus() local
244 for (i = qs+1; i < used; ++i) { in burl_normalize_qs20_to_plus()
245 if (s[i] == '%' && s[i+1] == '2' && s[i+2] == '0') break; in burl_normalize_qs20_to_plus()
247 if (i != used) burl_normalize_qs20_to_plus_fix(b, i); in burl_normalize_qs20_to_plus()
251 static int burl_normalize_2F_to_slash_fix (buffer *b, int qs, int i) in burl_normalize_2F_to_slash_fix() argument
256 int j = i; in burl_normalize_2F_to_slash_fix()
257 for (; i < used; ++i, ++j) { in burl_normalize_2F_to_slash_fix()
258 s[j] = s[i]; in burl_normalize_2F_to_slash_fix()
259 if (s[i] == '%' && s[i+1] == '2' && s[i+2] == 'F') { in burl_normalize_2F_to_slash_fix()
261 i+=2; in burl_normalize_2F_to_slash_fix()
280 for (int i = 0; i < used; ++i) { in burl_normalize_2F_to_slash() local
281 if (s[i] == '%' && s[i+1] == '2' && s[i+2] == 'F') { in burl_normalize_2F_to_slash()
283 ? burl_normalize_2F_to_slash_fix(b, qs, i) in burl_normalize_2F_to_slash()
296 for (int i = 0, len = qs < 0 ? used : qs; i < len; ++i) { in burl_normalize_path() local
297 if (s[i] == '.' && (s[i+1] != '.' || ++i) in burl_normalize_path()
298 && (s[i+1] == '/' || s[i+1] == '?' || s[i+1] == '\0')) { in burl_normalize_path()
302 while (i < len && s[i] != '/') ++i; in burl_normalize_path()
303 if (s[i] == '/' && s[i+1] == '/') { /*(s[len] != '/')*/ in burl_normalize_path()
393 for (unsigned int i = 0; i < len; ++i, ++j) { in burl_append_encode_nde() local
394 if (str[i]=='%' && li_cton(str[i+1], n1) && li_cton(str[i+2], n2)) { in burl_append_encode_nde()
401 p[++j] = str[i+1]; in burl_append_encode_nde()
402 p[++j] = str[i+2]; in burl_append_encode_nde()
404 i+=2; in burl_append_encode_nde()
406 else if (burl_is_unreserved(str[i])) { in burl_append_encode_nde()
407 p[j] = str[i]; in burl_append_encode_nde()
411 p[++j] = hex_chars_uc[(str[i] >> 4) & 0xF]; in burl_append_encode_nde()
412 p[++j] = hex_chars_uc[str[i] & 0xF]; in burl_append_encode_nde()
427 for (unsigned int i = 0; i < len; ++i, ++j) { in burl_append_encode_psnde() local
428 if (str[i]=='%' && li_cton(str[i+1], n1) && li_cton(str[i+2], n2)) { in burl_append_encode_psnde()
435 p[++j] = str[i+1]; in burl_append_encode_psnde()
436 p[++j] = str[i+2]; in burl_append_encode_psnde()
438 i+=2; in burl_append_encode_psnde()
440 else if (burl_is_unreserved(str[i]) || str[i] == '/') { in burl_append_encode_psnde()
441 p[j] = str[i]; in burl_append_encode_psnde()
445 p[++j] = hex_chars_uc[(str[i] >> 4) & 0xF]; in burl_append_encode_psnde()
446 p[++j] = hex_chars_uc[str[i] & 0xF]; in burl_append_encode_psnde()
460 for (unsigned int i = 0; i < len; ++i, ++j) { in burl_append_encode_all() local
461 if (burl_is_unreserved(str[i])) { in burl_append_encode_all()
462 p[j] = str[i]; in burl_append_encode_all()
466 p[++j] = hex_chars_uc[(str[i] >> 4) & 0xF]; in burl_append_encode_all()
467 p[++j] = hex_chars_uc[str[i] & 0xF]; in burl_append_encode_all()