MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / is_filesystem_path

Function is_filesystem_path

internal/cbm/helpers.c:2060–2069  ·  view source on GitHub ↗

Check if a slash-prefixed string looks like a filesystem path.

Source from the content-addressed store, hash-verified

2058
2059// Check if a slash-prefixed string looks like a filesystem path.
2060static bool is_filesystem_path(const char *s, int len) {
2061 if (len <= MIN_SYS_PATH_LEN) {
2062 return false;
2063 }
2064 return strncmp(s, "/usr/", SLEN("/usr/")) == 0 || strncmp(s, "/bin/", SLEN("/bin/")) == 0 ||
2065 strncmp(s, "/etc/", SLEN("/etc/")) == 0 || strncmp(s, "/var/", SLEN("/var/")) == 0 ||
2066 strncmp(s, "/tmp/", SLEN("/tmp/")) == 0 || strncmp(s, "/opt/", SLEN("/opt/")) == 0 ||
2067 strncmp(s, "/home/", SLEN("/home/")) == 0 || strncmp(s, "/dev/", SLEN("/dev/")) == 0 ||
2068 strncmp(s, "/sys/", SLEN("/sys/")) == 0 || strncmp(s, "/proc/", SLEN("/proc/")) == 0;
2069}
2070
2071// Check if a slash-prefixed string looks like a REST API path.
2072static bool is_rest_path(const char *s, int len) {

Callers 1

is_rest_pathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected