strncmp that treats "/" and "\" as the same character. On Windows a * canonical path arrives with backslashes from the resolver and with forward * slashes from callers that normalize, and both spell one directory. Stops at * the end of either string like strncmp does. */
| 245 | * slashes from callers that normalize, and both spell one directory. Stops at |
| 246 | * the end of either string like strncmp does. */ |
| 247 | static bool ws_prefix_equal(const char *a, const char *b, size_t len) { |
| 248 | for (size_t i = 0; i < len; i++) { |
| 249 | if (a[i] != b[i] && !(ws_is_sep(a[i]) && ws_is_sep(b[i]))) { |
| 250 | return false; |
| 251 | } |
| 252 | if (a[i] == '\0') { |
| 253 | break; |
| 254 | } |
| 255 | } |
| 256 | return true; |
| 257 | } |
| 258 | |
| 259 | /* True when b is a or lives under a. Compares on a separator boundary so |
| 260 | * "/a/bc" is not treated as living under "/a/b". */ |
no test coverage detected