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:3024–3037  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3022}
3023
3024static bool cbm_hook_script_name_safe(const char *script_name) {
3025 if (!script_name || !script_name[0]) {
3026 return false;
3027 }
3028 for (const unsigned char *cursor = (const unsigned char *)script_name; *cursor; cursor++) {
3029 bool safe = (*cursor >= 'a' && *cursor <= 'z') || (*cursor >= 'A' && *cursor <= 'Z') ||
3030 (*cursor >= '0' && *cursor <= '9') || *cursor == '-' || *cursor == '_' ||
3031 *cursor == '.';
3032 if (!safe) {
3033 return false;
3034 }
3035 }
3036 return true;
3037}
3038
3039/* Build the hook command string written into Claude Code's settings.json.
3040 * POSIX embeds a safely quoted absolute custom config path or a portable $HOME

Calls

no outgoing calls

Tested by

no test coverage detected