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