summaryrefslogtreecommitdiff
path: root/src/w32fns.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2018-08-18 09:24:38 +0300
committerEli Zaretskii <eliz@gnu.org>2018-08-18 09:24:38 +0300
commit877cd22f553624b6d7f24141acd134f9cf839259 (patch)
treeb0e397131a3c29319bbf4bd93bc6fd607db08b60 /src/w32fns.c
parent33002872364c69e2e6004fb981a8c975c3b38413 (diff)
downloademacs-877cd22f553624b6d7f24141acd134f9cf839259.tar.gz
Avoid compilation warning in w32fns.c
* src/w32fns.c (Fw32_read_registry): Avoid compiler warning regarding possible use of 'rootkey' without initializing it first. Reported by Andy Moreton <andrewjmoreton@gmail.com>.
Diffstat (limited to 'src/w32fns.c')
-rw-r--r--src/w32fns.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/w32fns.c b/src/w32fns.c
index c32868fa695..b587677f090 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -10125,7 +10125,7 @@ to be converted to forward slashes by the caller. */)
CHECK_STRING (key);
CHECK_STRING (name);
- HKEY rootkey;
+ HKEY rootkey = HKEY_CURRENT_USER;
if (EQ (root, QHKCR))
rootkey = HKEY_CLASSES_ROOT;
else if (EQ (root, QHKCU))
@@ -10139,10 +10139,7 @@ to be converted to forward slashes by the caller. */)
else if (!NILP (root))
error ("unknown root key: %s", SDATA (SYMBOL_NAME (root)));
- Lisp_Object val = w32_read_registry (NILP (root)
- ? HKEY_CURRENT_USER
- : rootkey,
- key, name);
+ Lisp_Object val = w32_read_registry (rootkey, key, name);
if (NILP (val) && NILP (root))
val = w32_read_registry (HKEY_LOCAL_MACHINE, key, name);