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

Function cbm_hook_script_name_safe

src/cli/cli.c:2440–2453  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2438}
2439
2440static bool cbm_hook_script_name_safe(const char *script_name) {
2441 if (!script_name || !script_name[0]) {
2442 return false;
2443 }
2444 for (const unsigned char *cursor = (const unsigned char *)script_name; *cursor; cursor++) {
2445 bool safe = (*cursor >= 'a' && *cursor <= 'z') || (*cursor >= 'A' && *cursor <= 'Z') ||
2446 (*cursor >= '0' && *cursor <= '9') || *cursor == '-' || *cursor == '_' ||
2447 *cursor == '.';
2448 if (!safe) {
2449 return false;
2450 }
2451 }
2452 return true;
2453}
2454
2455/* Build the hook command string written into Claude Code's settings.json.
2456 * POSIX embeds a safely quoted absolute custom config path or a portable $HOME

Calls

no outgoing calls

Tested by

no test coverage detected