mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-07-27 10:11:55 -07:00
input: improved path handling; null check return value of fopen. (#3061)
This commit is contained in:
@@ -784,10 +784,9 @@ void CInputManager::applyConfigToKeyboard(SKeyboard* pKeyboard) {
|
||||
if (!FILEPATH.empty()) {
|
||||
auto path = absolutePath(FILEPATH, g_pConfigManager->configCurrentPath);
|
||||
|
||||
if (!std::filesystem::exists(path))
|
||||
Debug::log(ERR, "input:kb_file= file doesnt exist");
|
||||
if (FILE* const KEYMAPFILE = fopen(path.c_str(), "r"); !KEYMAPFILE)
|
||||
Debug::log(ERR, "Cannot open input:kb_file= file for reading");
|
||||
else {
|
||||
FILE* const KEYMAPFILE = fopen(FILEPATH.c_str(), "r");
|
||||
KEYMAP = xkb_keymap_new_from_file(CONTEXT, KEYMAPFILE, XKB_KEYMAP_FORMAT_TEXT_V1, XKB_KEYMAP_COMPILE_NO_FLAGS);
|
||||
fclose(KEYMAPFILE);
|
||||
}
|
||||
|
Reference in New Issue
Block a user