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

Function watcher_windows_path_absolute

src/watcher/watcher.c:205–214  ·  view source on GitHub ↗

CreateProcessW does not search PATH when lpApplicationName is non-NULL. * Resolve Git ourselves, and deliberately accept only absolute PATH entries: * empty/relative entries would reintroduce Windows' current-directory search. */

Source from the content-addressed store, hash-verified

203 * Resolve Git ourselves, and deliberately accept only absolute PATH entries:
204 * empty/relative entries would reintroduce Windows' current-directory search. */
205static bool watcher_windows_path_absolute(const wchar_t *path) {
206 if (!path || wcslen(path) < 3U) {
207 return false;
208 }
209 bool drive = ((path[0] >= L'A' && path[0] <= L'Z') || (path[0] >= L'a' && path[0] <= L'z')) &&
210 path[1] == L':' && (path[2] == L'\\' || path[2] == L'/');
211 bool unc = (path[0] == L'\\' || path[0] == L'/') && (path[1] == L'\\' || path[1] == L'/') &&
212 path[2] != L'\0' && path[2] != L'\\' && path[2] != L'/';
213 return drive || unc;
214}
215
216static bool watcher_windows_git_candidate(const wchar_t *entry, size_t entry_length,
217 char output[CBM_SZ_4K]) {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected