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

Function cmdline_roundtrips

tests/test_subprocess.c:857–877  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

855}
856
857static bool cmdline_roundtrips(const char *const *argv) {
858 char cmd[4096];
859 if (!cbm_build_win_cmdline(cmd, sizeof(cmd), argv)) {
860 return false;
861 }
862 char parsed[16][256];
863 int pc = parse_win_cmdline(cmd, parsed, 16);
864 int oc = 0;
865 while (argv[oc]) {
866 oc++;
867 }
868 if (pc != oc) {
869 return false;
870 }
871 for (int i = 0; i < oc; i++) {
872 if (strcmp(argv[i], parsed[i]) != 0) {
873 return false;
874 }
875 }
876 return true;
877}
878
879/* The exact index-worker argv: the command line with a JSON arg full of quotes.
880 * Round-trips, AND the emitted line must contain an ESCAPED quote (\") — the bare

Callers 1

test_subprocess.cFile · 0.85

Calls 2

cbm_build_win_cmdlineFunction · 0.85
parse_win_cmdlineFunction · 0.85

Tested by

no test coverage detected