Strip the last path component in place. Returns false at a filesystem or * drive root (nothing left to strip). */
| 604 | /* Strip the last path component in place. Returns false at a filesystem or |
| 605 | * drive root (nothing left to strip). */ |
| 606 | static bool ha_strip_last_component(char *dir) { |
| 607 | char *slash = strrchr(dir, '/'); |
| 608 | if (!slash || slash == dir) { |
| 609 | return false; /* POSIX root "/" */ |
| 610 | } |
| 611 | if (slash == dir + 2 && dir[1] == ':') { |
| 612 | return false; /* Windows drive root "X:/" — don't strip to "X:" */ |
| 613 | } |
| 614 | *slash = '\0'; |
| 615 | return true; |
| 616 | } |
| 617 | |
| 618 | static bool ha_canonical_path(const char *input, char *output, size_t output_size); |
| 619 | static bool ha_path_contains(const char *root, const char *candidate); |
no outgoing calls
no test coverage detected