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

Function watcher_windows_path_absolute

src/watcher/watcher.c:270–279  ·  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

268 * Resolve Git ourselves, and deliberately accept only absolute PATH entries:
269 * empty/relative entries would reintroduce Windows' current-directory search. */
270static bool watcher_windows_path_absolute(const wchar_t *path) {
271 if (!path || wcslen(path) < 3U) {
272 return false;
273 }
274 bool drive = ((path[0] >= L'A' && path[0] <= L'Z') || (path[0] >= L'a' && path[0] <= L'z')) &&
275 path[1] == L':' && (path[2] == L'\\' || path[2] == L'/');
276 bool unc = (path[0] == L'\\' || path[0] == L'/') && (path[1] == L'\\' || path[1] == L'/') &&
277 path[2] != L'\0' && path[2] != L'\\' && path[2] != L'/';
278 return drive || unc;
279}
280
281static bool watcher_windows_git_candidate(const wchar_t *entry, size_t entry_length,
282 char output[CBM_SZ_4K]) {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected