Strip the last path component in place. Returns false at a filesystem or * drive root (nothing left to strip). */
| 528 | /* Strip the last path component in place. Returns false at a filesystem or |
| 529 | * drive root (nothing left to strip). */ |
| 530 | static bool ha_strip_last_component(char *dir) { |
| 531 | char *slash = strrchr(dir, '/'); |
| 532 | if (!slash || slash == dir) { |
| 533 | return false; /* POSIX root "/" */ |
| 534 | } |
| 535 | if (slash == dir + 2 && dir[1] == ':') { |
| 536 | return false; /* Windows drive root "X:/" — don't strip to "X:" */ |
| 537 | } |
| 538 | *slash = '\0'; |
| 539 | return true; |
| 540 | } |
| 541 | |
| 542 | static bool ha_canonical_path(const char *input, char *output, size_t output_size); |
| 543 | static bool ha_path_contains(const char *root, const char *candidate); |
no outgoing calls
no test coverage detected