debug_git(): add a newline after each message
[git-cheetah.git] / systeminfo.c
blob08429bf7d80817cbbfd62d4aabc5c6a8db4dbcda
1 #include <windows.h>
2 #include "systeminfo.h"
4 static TCHAR msysPath[MAX_PATH];
6 TCHAR * msys_path(void)
8 static int found_path = 0;
9 HKEY hKey;
10 LONG lRet;
12 /* Only bother to get it once. */
13 if (found_path)
14 return msysPath;
16 lRet = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
17 TEXT(GIT_CHEETAH_REG_PATH),
18 0, KEY_QUERY_VALUE, &hKey);
20 if (lRet == ERROR_SUCCESS)
22 DWORD msysPathLen = MAX_PATH * sizeof(TCHAR);
24 lRet = RegQueryValueEx(hKey,
25 TEXT(GIT_CHEETAH_REG_PATHTOMSYS),
26 NULL, NULL,
27 (LPBYTE)msysPath,
28 &msysPathLen);
29 RegCloseKey(hKey);
31 if (lRet == ERROR_SUCCESS)
33 found_path = 1;
34 return msysPath;
38 return NULL;