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

Function gf_split_flags

src/mcp/test_impact_git.c:194–218  ·  view source on GitHub ↗

These are compile-time project constants containing simple space-separated * argv tokens, not user command text. No shell quoting or expansion is used. */

Source from the content-addressed store, hash-verified

192/* These are compile-time project constants containing simple space-separated
193 * argv tokens, not user command text. No shell quoting or expansion is used. */
194static bool gf_split_flags(cbm_git_facts_t *facts, const char *literal, const char **tokens,
195 int *count) {
196 *count = 0;
197 char *copy = cbm_arena_strdup(&facts->arena, literal);
198 if (!copy)
199 return false;
200 char *p = copy;
201 while (*p) {
202 while (*p == ' ')
203 p++;
204 if (!*p)
205 break;
206 if (*count == GF_FLAG_CAP)
207 return false;
208 tokens[(*count)++] = p;
209 while (*p && *p != ' ') {
210 if (*p == '\t' || *p == '\n' || *p == '\r' || *p == '\'' || *p == '"')
211 return false;
212 p++;
213 }
214 if (*p)
215 *p++ = '\0';
216 }
217 return true;
218}
219
220#ifdef _WIN32
221/* Same owner-only, protected, inheritable ACL as compat.c's private helper,

Callers 1

cbm_git_facts_openFunction · 0.85

Calls 1

cbm_arena_strdupFunction · 0.50

Tested by

no test coverage detected