summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Wagner <dwagner@rydia.us>2024-06-05 20:01:19 +0200
committerChristian Brabandt <cb@256bit.org>2024-06-05 20:01:19 +0200
commit84d9611b673230a0e1e8fd57423976d30ef36308 (patch)
treefcab69733f8992774a704d02f01bac67d62db723
parent9c60890518ed4e82afd6980bf0ecf5bbcc356ce6 (diff)
patch 9.1.0468: GvimExt does not consult HKEY_CURRENT_USERv9.1.0468
Problem: GvimExt does not consult HKEY_CURRENT_USER Solution: Make GvimExt first consult HKEY_CURRENT_USER and then fall back to HKEY_LOCAL_MACHINE to find gvim (David Wagner) fixes: #14904 closes: #14917 Signed-off-by: David Wagner <dwagner@rydia.us> Signed-off-by: Christian Brabandt <cb@256bit.org>
-rw-r--r--src/GvimExt/gvimext.cpp19
-rw-r--r--src/version.c2
2 files changed, 19 insertions, 2 deletions
diff --git a/src/GvimExt/gvimext.cpp b/src/GvimExt/gvimext.cpp
index e58b142555..f98423c15f 100644
--- a/src/GvimExt/gvimext.cpp
+++ b/src/GvimExt/gvimext.cpp
@@ -55,9 +55,11 @@ getGvimName(char *name, int runtime)
HKEY keyhandle;
DWORD hlen;
- // Get the location of gvim from the registry.
+ // Get the location of gvim from the registry. Try
+ // HKEY_CURRENT_USER first, then fall back to HKEY_LOCAL_MACHINE if
+ // not found.
name[0] = 0;
- if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, "Software\\Vim\\Gvim", 0,
+ if (RegOpenKeyEx(HKEY_CURRENT_USER, "Software\\Vim\\Gvim", 0,
KEY_READ, &keyhandle) == ERROR_SUCCESS)
{
hlen = BUFSIZE;
@@ -69,6 +71,19 @@ getGvimName(char *name, int runtime)
RegCloseKey(keyhandle);
}
+ if ((name[0] == 0) &&
+ (RegOpenKeyEx(HKEY_LOCAL_MACHINE, "Software\\Vim\\Gvim", 0,
+ KEY_READ, &keyhandle) == ERROR_SUCCESS))
+ {
+ hlen = BUFSIZE;
+ if (RegQueryValueEx(keyhandle, "path", 0, NULL, (BYTE *)name, &hlen)
+ != ERROR_SUCCESS)
+ name[0] = 0;
+ else
+ name[hlen] = 0;
+ RegCloseKey(keyhandle);
+ }
+
// Registry didn't work, use the search path.
if (name[0] == 0)
strcpy(name, searchpath((char *)"gvim.exe"));
diff --git a/src/version.c b/src/version.c
index 92498e1dae..92106bc3a4 100644
--- a/src/version.c
+++ b/src/version.c
@@ -705,6 +705,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 468,
+/**/
467,
/**/
466,