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

Function is_filesystem_path

internal/cbm/helpers.c:1346–1355  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1344
1345// Check if a slash-prefixed string looks like a filesystem path.
1346static bool is_filesystem_path(const char *s, int len) {
1347 if (len <= MIN_SYS_PATH_LEN) {
1348 return false;
1349 }
1350 return strncmp(s, "/usr/", SLEN("/usr/")) == 0 || strncmp(s, "/bin/", SLEN("/bin/")) == 0 ||
1351 strncmp(s, "/etc/", SLEN("/etc/")) == 0 || strncmp(s, "/var/", SLEN("/var/")) == 0 ||
1352 strncmp(s, "/tmp/", SLEN("/tmp/")) == 0 || strncmp(s, "/opt/", SLEN("/opt/")) == 0 ||
1353 strncmp(s, "/home/", SLEN("/home/")) == 0 || strncmp(s, "/dev/", SLEN("/dev/")) == 0 ||
1354 strncmp(s, "/sys/", SLEN("/sys/")) == 0 || strncmp(s, "/proc/", SLEN("/proc/")) == 0;
1355}
1356
1357// Check if a slash-prefixed string looks like a REST API path.
1358static 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