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

Function spawn_prefix_word

internal/cbm/spawn_patterns.c:679–691  ·  view source on GitHub ↗

A shell word that is not the program: an environment assignment * (`LC_ALL=C make`) or the `env` that runs the program after them * (`/usr/bin/env make`). */

Source from the content-addressed store, hash-verified

677 * (`LC_ALL=C make`) or the `env` that runs the program after them
678 * (`/usr/bin/env make`). */
679static bool spawn_prefix_word(const char *word, size_t len) {
680 static const char env[] = "env";
681 size_t env_len = sizeof(env) - 1;
682 if (len >= env_len && strncmp(word + len - env_len, env, env_len) == 0 &&
683 (len == env_len || word[len - env_len - 1] == '/')) {
684 return true;
685 }
686 size_t i = 0;
687 while (i < len && spawn_word_char(word[i])) {
688 i++;
689 }
690 return i > 0 && i < len && word[i] == '=';
691}
692
693/* The program word of a command line: its first word that is not an
694 * environment prefix, without directories. Anything built at run time is not

Callers 1

spawn_program_wordFunction · 0.85

Calls 1

spawn_word_charFunction · 0.85

Tested by

no test coverage detected