From 18cfbc90f2fef1f2948b5fb440859a40f44dce7a Mon Sep 17 00:00:00 2001 From: kichikuou Date: Sat, 20 Jan 2024 09:38:44 +0900 Subject: [PATCH] Windows: Do not read profile from registry This was only used for the default font path, so it should be safe to remove it. --- src/profile.c | 35 ----------------------------------- 1 file changed, 35 deletions(-) diff --git a/src/profile.c b/src/profile.c index 26f084d..8f31e43 100644 --- a/src/profile.c +++ b/src/profile.c @@ -28,12 +28,6 @@ #include #include #include -#ifdef _WIN32 -#include -#include "win/resources.h" -#undef min -#undef max -#endif #include "portab.h" #include "profile.h" @@ -138,37 +132,8 @@ static int load_rc_file(const char *profile_path) return 0; } -#ifdef _WIN32 -static void load_profile_from_registry(HKEY rootKey) -{ - HKEY hKey; - LSTATUS err = RegOpenKeyEx(rootKey, REGKEY_PROFILE, 0, KEY_QUERY_VALUE, &hKey); - if (err != ERROR_SUCCESS) - return; - - for (DWORD index = 0;; index++) { - char name[64]; - BYTE value[RC_LINE_CHARS_MAX]; - DWORD name_size = sizeof(name); - DWORD value_size = sizeof(value); - DWORD type; - err = RegEnumValue(hKey, index, name, &name_size, NULL, &type, value, &value_size); - if (err != ERROR_SUCCESS) - break; - if (type != REG_SZ) - continue; - insert_profile(name, value); - } -} -#endif // _WIN32 - int load_profile(void) { -#ifdef _WIN32 - load_profile_from_registry(HKEY_LOCAL_MACHINE); - load_profile_from_registry(HKEY_CURRENT_USER); -#endif // _WIN32 - char *home_dir; if ((home_dir = getenv("HOME"))) { char profile_path[PATH_MAX];