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

Function cmdline_roundtrips

tests/test_subprocess.c:1532–1552  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1530}
1531
1532static bool cmdline_roundtrips(const char *const *argv) {
1533 char cmd[4096];
1534 if (!cbm_build_win_cmdline(cmd, sizeof(cmd), argv)) {
1535 return false;
1536 }
1537 char parsed[16][256];
1538 int pc = parse_win_cmdline(cmd, parsed, 16);
1539 int oc = 0;
1540 while (argv[oc]) {
1541 oc++;
1542 }
1543 if (pc != oc) {
1544 return false;
1545 }
1546 for (int i = 0; i < oc; i++) {
1547 if (strcmp(argv[i], parsed[i]) != 0) {
1548 return false;
1549 }
1550 }
1551 return true;
1552}
1553
1554/* The exact index-worker argv: the command line with a JSON arg full of quotes.
1555 * 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