mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-06 23:26:39 +00:00
Implemented the full msysgit fallback chain
Signed-off-by: Sven Strickroth <email@cs-ware.de>
This commit is contained in:
parent
c378a1184e
commit
f2b126c76e
@ -493,11 +493,20 @@ int git_futils_find_global_file(git_buf *path, const char *filename)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (win32_expand_path(&root, L"%HOMEDRIVE%\\%HOMEPATH%\\") < 0 ||
|
if (getenv("HOMEPATH") != NULL) {
|
||||||
root.path[0] == L'%') /* i.e. no expansion happened */
|
if (win32_expand_path(&root, L"%HOMEDRIVE%%HOMEPATH%\\") < 0 ||
|
||||||
{
|
root.path[0] == L'%') /* i.e. no expansion happened */
|
||||||
giterr_set(GITERR_OS, "Cannot locate the user's profile directory");
|
{
|
||||||
return -1;
|
giterr_set(GITERR_OS, "Cannot locate the user's profile directory");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (win32_expand_path(&root, L"%USERPROFILE%\\") < 0 ||
|
||||||
|
root.path[0] == L'%') /* i.e. no expansion happened */
|
||||||
|
{
|
||||||
|
giterr_set(GITERR_OS, "Cannot locate the user's profile directory");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (win32_find_file(path, &root, filename) < 0) {
|
if (win32_find_file(path, &root, filename) < 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user