[git] GpgOL - branch, master, updated. gpgol-2.3.1-3-g1f378c0
by Andre Heinecke
cvs at cvs.gnupg.org
Mon Oct 22 11:59:34 CEST 2018
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GnuPG extension for MS Outlook".
The branch, master has been updated
via 1f378c00bda53cec3057ef27684b671293cc21ac (commit)
via 50e65b8425e2dece5dc791269bc564168bf819e1 (commit)
from 236541264560b59311613c70e7dc01bde537c70a (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 1f378c00bda53cec3057ef27684b671293cc21ac
Author: Andre Heinecke <aheinecke at intevation.de>
Date: Mon Oct 22 11:56:28 2018 +0200
Fix HKLM fallback for config values
* src/common.cpp (load_extension_value): Use read_w32_registry_string.
(load_config_value, expand_path): Removed.
--
We don't need two ways to access the registry. And the
load_config_value codepath did not fallback to HKLM.
GnuPG-Bug-Id: T4204
diff --git a/src/common.cpp b/src/common.cpp
index f3ec09f..72fa16f 100644
--- a/src/common.cpp
+++ b/src/common.cpp
@@ -770,78 +770,6 @@ gpgol_bug (HWND parent, int code)
return;
}
-static char*
-expand_path (const char *path)
-{
- DWORD len;
- char *p;
-
- len = ExpandEnvironmentStrings (path, NULL, 0);
- if (!len)
- {
- return NULL;
- }
- len += 1;
- p = (char *) xcalloc (1, len+1);
- if (!p)
- {
- return NULL;
- }
- len = ExpandEnvironmentStrings (path, p, len);
- if (!len)
- {
- xfree (p);
- return NULL;
- }
- return p;
-}
-
-static int
-load_config_value (HKEY hk, const char *path, const char *key, char **val)
-{
- HKEY h;
- DWORD size=0, type;
- int ec;
-
- *val = NULL;
- if (hk == NULL)
- {
- hk = HKEY_CURRENT_USER;
- }
- ec = RegOpenKeyEx (hk, path, 0, KEY_READ, &h);
- if (ec != ERROR_SUCCESS)
- {
- return -1;
- }
-
- ec = RegQueryValueEx(h, key, NULL, &type, NULL, &size);
- if (ec != ERROR_SUCCESS)
- {
- RegCloseKey (h);
- return -1;
- }
- if (type == REG_EXPAND_SZ)
- {
- char tmp[256];
- RegQueryValueEx (h, key, NULL, NULL, (BYTE*)tmp, &size);
- *val = expand_path (tmp);
- }
- else
- {
- *val = (char *) xcalloc(1, size+1);
- ec = RegQueryValueEx (h, key, NULL, &type, (BYTE*)*val, &size);
- if (ec != ERROR_SUCCESS)
- {
- xfree (*val);
- *val = NULL;
- RegCloseKey (h);
- return -1;
- }
- }
- RegCloseKey (h);
- return 0;
-}
-
static int
store_config_value (HKEY hk, const char *path, const char *key, const char *val)
{
@@ -885,14 +813,16 @@ store_extension_value (const char *key, const char *val)
int
load_extension_value (const char *key, char **val)
{
- int ret = load_config_value (HKEY_CURRENT_USER, GPGOL_REGPATH, key, val);
- if (val)
+ if (!val)
{
- log_debug ("%s:%s: LoadReg '%s' val '%s'",
- SRCNAME, __func__, key ? key : "null",
- *val ? *val : "null");
+ STRANGEPOINT;
+ return -1;
}
- return ret;
+ *val = read_w32_registry_string (nullptr, GPGOL_REGPATH, key);
+ log_debug ("%s:%s: LoadReg '%s' val '%s'",
+ SRCNAME, __func__, key ? key : "null",
+ *val ? *val : "null");
+ return 0;
}
int
commit 50e65b8425e2dece5dc791269bc564168bf819e1
Author: Andre Heinecke <aheinecke at intevation.de>
Date: Tue Oct 16 14:14:29 2018 +0200
Pass lang correctly to config dialog
* src/addin-options.cpp (open_gpgolconfig): Pass lang.
diff --git a/src/addin-options.cpp b/src/addin-options.cpp
index d82b095..137d880 100644
--- a/src/addin-options.cpp
+++ b/src/addin-options.cpp
@@ -185,6 +185,9 @@ open_gpgolconfig (LPVOID arg)
args.push_back (std::string("--gpgol-version"));
args.push_back (std::string(VERSION));
+ args.push_back (std::string ("--lang"));
+ args.push_back (std::string (gettext_localename ()));
+
auto ctx = GpgME::Context::createForEngine (GpgME::SpawnEngine);
if (!ctx)
{
-----------------------------------------------------------------------
Summary of changes:
src/addin-options.cpp | 3 ++
src/common.cpp | 86 +++++----------------------------------------------
2 files changed, 11 insertions(+), 78 deletions(-)
hooks/post-receive
--
GnuPG extension for MS Outlook
http://git.gnupg.org
More information about the Gnupg-commits
mailing list