diff options
author | Lubomir I. Ivanov <neolit123@gmail.com> | 2013-03-02 16:14:41 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-03-02 08:45:42 -0800 |
commit | 3443abea721c9d5d8100c82e5b2dc9f543c5092c (patch) | |
tree | 0638eeaaa9667cc90e235f6baa5216e026e6c387 /windows.c | |
parent | aa02798e2a6ca1a91dbfe444327f5eeb61744ea6 (diff) | |
download | subsurface-3443abea721c9d5d8100c82e5b2dc9f543c5092c.tar.gz |
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 <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'windows.c')
-rw-r--r-- | windows.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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) |