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

Function sh_may_split

src/pipeline/pass_shell.c:996–1010  ·  view source on GitHub ↗

An unquoted expansion may split into several words. */

Source from the content-addressed store, hash-verified

994
995/* An unquoted expansion may split into several words. */
996static bool sh_may_split(TSNode w) {
997 const char *t = ts_node_type(w);
998 if (strcmp(t, "simple_expansion") == 0 || strcmp(t, "expansion") == 0 ||
999 strcmp(t, "command_substitution") == 0) {
1000 return true;
1001 }
1002 if (strcmp(t, "concatenation") == 0) {
1003 for (uint32_t i = 0; i < ts_node_named_child_count(w); i++) {
1004 if (sh_may_split(ts_node_named_child(w, i))) {
1005 return true;
1006 }
1007 }
1008 }
1009 return false;
1010}
1011
1012static void sh_argv_push(sh_argv_t *a, const char *v, bool split, uint32_t b, uint32_t e) {
1013 if (a->n >= a->cap) {

Callers 1

sh_argv_wordFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected