["']([^"']+)["'] at s[i]: the value span, or false. */
| 271 | |
| 272 | /* ["']([^"']+)["'] at s[i]: the value span, or false. */ |
| 273 | static bool py_quoted_value(const char *s, size_t n, size_t i, size_t *va, size_t *vb) { |
| 274 | if (i >= n || (s[i] != '"' && s[i] != '\'')) { |
| 275 | return false; |
| 276 | } |
| 277 | size_t j = i + 1; |
| 278 | while (j < n && s[j] != '"' && s[j] != '\'') { |
| 279 | j++; |
| 280 | } |
| 281 | if (j == i + 1 || j >= n) { |
| 282 | return false; |
| 283 | } |
| 284 | *va = i + 1; |
| 285 | *vb = j; |
| 286 | return true; |
| 287 | } |
| 288 | |
| 289 | /* /(blob|tree)/[^/]+/%s in the URL: a repository path pattern. */ |
| 290 | static bool py_repo_url(const char *u, size_t n) { |