From 3443abea721c9d5d8100c82e5b2dc9f543c5092c Mon Sep 17 00:00:00 2001 From: "Lubomir I. Ivanov" Date: Sat, 2 Mar 2013 16:14:41 +0200 Subject: windows.c: Fix broken subsurface_unset_conf() windows.c has be revisited so many times, yet just now I've noticed that we aren't deleting/unsetting a configuration value ever. What has went strangely unnoticed is that subsurface_unset_conf() needs RegDeleteValue instead of RegDeleteKey. "keys" in the Windows registry are like folders which contain files (or "values"). So in this case we need to delete a "file" and not a "folder" using RegDeleteValue(). This ended up being a problem with the new prefs.c logic, where there is a check if a config value is the default value and then it will be unset/deleted. There was potential for a crash, where a NULL value can reach pango_font_description_from_string() for the divelist font. It also wasn't possible to change the divelist font back to the default font (e.g. Sans 8), once a different font was selected. Signed-off-by: Lubomir I. Ivanov Signed-off-by: Dirk Hohndel --- windows.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/windows.c b/windows.c index 2eed74143..b711480f3 100644 --- a/windows.c +++ b/windows.c @@ -22,7 +22,7 @@ void subsurface_open_conf(void) void subsurface_unset_conf(char *name) { - RegDeleteKey(hkey, (LPCTSTR)name); + RegDeleteValue(hkey, (LPCTSTR)name); } void subsurface_set_conf(char *name, const char *value) -- cgit v1.2.3-70-g09d2