Commit 82f1ffef6d67cd1f5f5cf588e69353e2ed665113 Parent: fc08ca3443b8bc7b46c796d0d42bc499ba9fa65f Author: mcol <mcol@posteo.net> Date: 2021-01-26 22:26:51 +0000 Committer: mcol <mcol@posteo.net> Committed: 2021-01-26 22:26:51 +0000 don't die when there is a mistake in the config
src/config.c Modified
@@ -194,8 +194,9 @@ // key kb->key = xkb_keysym_from_name(s, XKB_KEYSYM_NO_FLAGS); - if (kb->key == XKB_KEY_NoSymbol) + if (kb->key == XKB_KEY_NoSymbol) { kb->key = xkb_keysym_from_name(s, XKB_KEYSYM_CASE_INSENSITIVE); + } if (kb->key == XKB_KEY_NoSymbol) { kb->key = get(mouse_keys, s); @@ -209,6 +210,10 @@ // action s = strtok(NULL, " \t\n\r"); + if (!s) { + wlr_log(WLR_ERROR, "Config line %i: malformed option.", line); + return; + } if (!assign_action(s, strtok(NULL, "\n\r"), kb)) { wlr_log(WLR_ERROR, "Config line %i: No such action '%s'.", line, s); free(kb); @@ -444,6 +449,8 @@ wimp.reverse_scrolling = false; else if (!strcasecmp(s, "reverse")) wimp.reverse_scrolling = true; + } else { + wlr_log(WLR_ERROR, "Config line %i: unknown option '%s'.", line, s); } } }