| 244 | } |
| 245 | |
| 246 | bool |
| 247 | path_equal (const char *path1, |
| 248 | const char *path2) |
| 249 | { |
| 250 | while (true) |
| 251 | { |
| 252 | /* Skip consecutive slashes to reach next path |
| 253 | element */ |
| 254 | while (*path1 == '/') |
| 255 | path1++; |
| 256 | while (*path2 == '/') |
| 257 | path2++; |
| 258 | |
| 259 | /* No more prefix path elements? Done! */ |
| 260 | if (*path1 == 0 || *path2 == 0) |
| 261 | return *path1 == 0 && *path2 == 0; |
| 262 | |
| 263 | /* Compare path element */ |
| 264 | while (*path1 != 0 && *path1 != '/') |
| 265 | { |
| 266 | if (*path1 != *path2) |
| 267 | return false; |
| 268 | path1++; |
| 269 | path2++; |
| 270 | } |
| 271 | |
| 272 | /* Matched path1 path element, must be entire path element */ |
| 273 | if (*path2 != '/' && *path2 != 0) |
| 274 | return false; |
| 275 | } |
| 276 | } |
| 277 | |
| 278 | |
| 279 | bool |
no outgoing calls
no test coverage detected