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

Function cmdline_roundtrips

tests/test_subprocess.c:241–261  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

239}
240
241static bool cmdline_roundtrips(const char *const *argv) {
242 char cmd[4096];
243 if (!cbm_build_win_cmdline(cmd, sizeof(cmd), argv)) {
244 return false;
245 }
246 char parsed[16][256];
247 int pc = parse_win_cmdline(cmd, parsed, 16);
248 int oc = 0;
249 while (argv[oc]) {
250 oc++;
251 }
252 if (pc != oc) {
253 return false;
254 }
255 for (int i = 0; i < oc; i++) {
256 if (strcmp(argv[i], parsed[i]) != 0) {
257 return false;
258 }
259 }
260 return true;
261}
262
263/* The exact index-worker argv: the command line with a JSON arg full of quotes.
264 * 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