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. */
| 268 | * Resolve Git ourselves, and deliberately accept only absolute PATH entries: |
| 269 | * empty/relative entries would reintroduce Windows' current-directory search. */ |
| 270 | static 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 | |
| 281 | static bool watcher_windows_git_candidate(const wchar_t *entry, size_t entry_length, |
| 282 | char output[CBM_SZ_4K]) { |
no outgoing calls
no test coverage detected