summaryrefslogtreecommitdiff
path: root/src/win32/findfile.c
diff options
context:
space:
mode:
authorVicent Martí <vicent@github.com>2013-09-17 08:00:44 -0700
committerVicent Martí <vicent@github.com>2013-09-17 08:00:44 -0700
commit92457cad4123c6ee9bc56ce548285e09d06c204c (patch)
tree217b015c30f4aeb27881e42a4ceae6ba9850d94f /src/win32/findfile.c
parentefc9e6700fabc91ea490fcc5ea034b51648c9e88 (diff)
parent89095fbddcba3c3e27d0573bc7202ca9a5f4f00b (diff)
downloadlibgit2-92457cad4123c6ee9bc56ce548285e09d06c204c.tar.gz
Merge pull request #1857 from linquize/find-git-path-win32
Fix failure in win32 git path guessing
Diffstat (limited to 'src/win32/findfile.c')
-rw-r--r--src/win32/findfile.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/win32/findfile.c b/src/win32/findfile.c
index a1c11fcfb..d8b8f60ca 100644
--- a/src/win32/findfile.c
+++ b/src/win32/findfile.c
@@ -130,9 +130,9 @@ static int win32_find_git_in_registry(
assert(buf);
- path16.len = 0;
+ path16.len = MAX_PATH;
- if (RegOpenKeyExW(hieve, key, 0, KEY_ALL_ACCESS, &hKey) == ERROR_SUCCESS) {
+ if (RegOpenKeyExW(hieve, key, 0, KEY_READ, &hKey) == ERROR_SUCCESS) {
if (RegQueryValueExW(hKey, L"InstallLocation", NULL, &dwType,
(LPBYTE)&path16.path, &path16.len) == ERROR_SUCCESS)
{