From 1af559a9a24fd930094ab7b466ed051cdbc66f99 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Mon, 13 Dec 2021 19:24:40 +0100 Subject: [PATCH] common,w32: Sync read_w32_registry_string with the gpgrt version * common/w32-reg.c (get_root_key): Add short version of the root classes. -- The code here is only used by gpgconf's new --show-configs command. Usually on Windows the code from gpgrt is used for reading the registry. This one here is an exception and when backporting it I missed to add the HKCU etc al string. Fixes-commit: 6c6c404883e52545ed38293384c95fdacb7227c4 GnuPG-bug-id: 5724 --- common/w32-reg.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/common/w32-reg.c b/common/w32-reg.c index f36c66453..fda2d1cfa 100644 --- a/common/w32-reg.c +++ b/common/w32-reg.c @@ -54,17 +54,17 @@ get_root_key(const char *root) if (!root) root_key = HKEY_CURRENT_USER; - else if (!strcmp( root, "HKEY_CLASSES_ROOT" ) ) + else if (!strcmp (root, "HKEY_CLASSES_ROOT") || !strcmp (root, "HKCR")) root_key = HKEY_CLASSES_ROOT; - else if (!strcmp( root, "HKEY_CURRENT_USER" ) ) + else if (!strcmp (root, "HKEY_CURRENT_USER") || !strcmp (root, "HKCU")) root_key = HKEY_CURRENT_USER; - else if (!strcmp( root, "HKEY_LOCAL_MACHINE" ) ) + else if (!strcmp (root, "HKEY_LOCAL_MACHINE") || !strcmp (root, "HKLM")) root_key = HKEY_LOCAL_MACHINE; - else if (!strcmp( root, "HKEY_USERS" ) ) + else if (!strcmp (root, "HKEY_USERS") || !strcmp (root, "HKU")) root_key = HKEY_USERS; - else if (!strcmp( root, "HKEY_PERFORMANCE_DATA" ) ) + else if (!strcmp (root, "HKEY_PERFORMANCE_DATA")) root_key = HKEY_PERFORMANCE_DATA; - else if (!strcmp( root, "HKEY_CURRENT_CONFIG" ) ) + else if (!strcmp (root, "HKEY_CURRENT_CONFIG") || !strcmp (root, "HKCC")) root_key = HKEY_CURRENT_CONFIG; else return NULL;