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

Function cmdline_roundtrips

tests/test_subprocess.c:896–916  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

894}
895
896static bool cmdline_roundtrips(const char *const *argv) {
897 char cmd[4096];
898 if (!cbm_build_win_cmdline(cmd, sizeof(cmd), argv)) {
899 return false;
900 }
901 char parsed[16][256];
902 int pc = parse_win_cmdline(cmd, parsed, 16);
903 int oc = 0;
904 while (argv[oc]) {
905 oc++;
906 }
907 if (pc != oc) {
908 return false;
909 }
910 for (int i = 0; i < oc; i++) {
911 if (strcmp(argv[i], parsed[i]) != 0) {
912 return false;
913 }
914 }
915 return true;
916}
917
918/* The exact index-worker argv: the command line with a JSON arg full of quotes.
919 * 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