Return the last "count" path elements from the concatenated string. * We return a string pointer to the start of the string, and update the * array pointer-pointer to point to any remaining string elements. */
| 258 | * We return a string pointer to the start of the string, and update the |
| 259 | * array pointer-pointer to point to any remaining string elements. */ |
| 260 | static const uchar *trailing_N_elements(const uchar*const **a_ptr, int count) |
| 261 | { |
| 262 | const uchar*const *a = *a_ptr; |
| 263 | const uchar*const *first_a = a; |
| 264 | |
| 265 | while (*a) |
| 266 | a++; |
| 267 | |
| 268 | while (a != first_a) { |
| 269 | const uchar *s = *--a; |
| 270 | s += strlen((char*)s); |
| 271 | while (--s >= *a) { |
| 272 | if (*s == '/' && !--count) { |
| 273 | *a_ptr = a+1; |
| 274 | return s+1; |
| 275 | } |
| 276 | } |
| 277 | } |
| 278 | |
| 279 | if (count == 1) { |
| 280 | *a_ptr = a+1; |
| 281 | return *a; |
| 282 | } |
| 283 | |
| 284 | return NULL; |
| 285 | } |
| 286 | |
| 287 | /* Match the "pattern" against the "text" string. */ |
| 288 | int wildmatch(const char *pattern, const char *text) |
no outgoing calls
no test coverage detected