Skip to content

Local code intelligence for developers and AI agents. Connect code, docs and infrastructure in a persistent graph, with CBM Lens, MCP tools, agent integrations and change-aware test selection.

Normalize cbm_mkdtemp output to forward slashes on Windows

Martin Vogelc993c8cf8493
diff --git a/src/foundation/compat.c b/src/foundation/compat.c
index 18bafdb4b..e59accf7e 100644
--- a/src/foundation/compat.c
+++ b/src/foundation/compat.c
@@ -72,6 +72,14 @@ char *cbm_mkdtemp(char *tmpl) {
return NULL;
if (_mkdir(buf) != 0)
return NULL;
+ /* Normalize to forward slashes. Callers embed this path in JSON repo_path
+ * (where "\t"/"\a" are invalid escapes → index fails) and pass it to git -C.
+ * Windows file APIs accept forward slashes, so the created dir is unaffected. */
+ for (char *p = buf; *p; p++) {
+ if (*p == '\\') {
+ *p = '/';
+ }
+ }
/* Copy result back — callers now use char[CBM_SZ_256]+ buffers */
strcpy(tmpl, buf);
return tmpl;