INNER CODE UNIT · C
paths_match
witchan/ios-mcp · mcp-root/main.c:108
static int paths_match(const char *lhs, const char *rhs) {
if (!lhs || !rhs) {
return 0;
}
char lhsResolved[PATH_MAX];
char rhsResolved[PATH_MAX];
if (canonicalize_existing_path(lhs, lhsResolved, sizeof(lhsResolved)) &&
canonicalize_existing_path(rhs, rhsResolved, sizeof(rhsResolved))) {
return strcmp(lhsResolved, rhsResolved) == 0;
}
return strcmp(lhs, rhs) == 0;
}
static int path_has_prefix(const char *path, const char *prefix) {
size_t prefixLen;