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

Function unquote_string

internal/cbm/extract_channels.c:51–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49/* ── String literal helpers ──────────────────────────────────────── */
50
51static const char *unquote_string(CBMArena *a, const char *s) {
52 if (!s) {
53 return NULL;
54 }
55 size_t len = strlen(s);
56 if (len < CBM_QUOTE_PAIR) {
57 return NULL;
58 }
59 char first = s[0];
60 char last = s[len - CBM_QUOTE_OFFSET];
61 if ((first == '"' && last == '"') || (first == '\'' && last == '\'') ||
62 (first == '`' && last == '`')) {
63 return cbm_arena_strndup(a, s + CBM_QUOTE_OFFSET, len - CBM_QUOTE_PAIR);
64 }
65 return NULL;
66}
67
68/* Extract a literal channel name from an argument node. Returns NULL if the
69 * argument is not a plain string literal (caller can then try identifier

Callers 2

literal_from_argFunction · 0.85
scan_string_consts_jsFunction · 0.85

Calls 1

cbm_arena_strndupFunction · 0.70

Tested by

no test coverage detected