Normalize a folder path: "" and "." mean the root; strip trailing '/'. */
| 31 | |
| 32 | /* Normalize a folder path: "" and "." mean the root; strip trailing '/'. */ |
| 33 | static void aa_norm_path(const char *in, char *out, size_t cap) { |
| 34 | if (!in || !in[0] || strcmp(in, ".") == 0) { |
| 35 | out[0] = '\0'; |
| 36 | return; |
| 37 | } |
| 38 | snprintf(out, cap, "%s", in); |
| 39 | size_t len = strlen(out); |
| 40 | while (len > 0 && out[len - 1] == '/') |
| 41 | out[--len] = '\0'; |
| 42 | } |
| 43 | |
| 44 | /* The next path component of `full` under folder `prefix` ("" = root). |
| 45 | * Returns false when `full` is not under `prefix`. `is_direct_file` is true |
no outgoing calls
no test coverage detected