diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2020-03-12 16:19:54 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2020-03-12 16:19:54 +0000 |
| commit | 6657573866c99a37093049168bd992277b8c16f6 (patch) | |
| tree | 7d460285b012423e0062439a9b2325c36a055b1a | |
| parent | config: key-bindings: verify key combo isn't already mapped to another action (diff) | |
| parent | quirks: weston_csd_{on,off}: don't do anything in fullscreen mode (diff) | |
Merge branch 'master' into bindings
| -rw-r--r-- | config.c | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -138,6 +138,15 @@ get_config_path(void) } static bool +str_to_bool(const char *s) +{ + return strcasecmp(s, "on") == 0 || + strcasecmp(s, "true") == 0 || + strcasecmp(s, "yes") == 0 || + strtoul(s, NULL, 0) > 0; +} + +static bool str_to_ulong(const char *s, int base, unsigned long *res) { if (s == NULL) @@ -196,11 +205,7 @@ parse_section_main(const char *key, const char *value, struct config *conf, } else if (strcmp(key, "login-shell") == 0) { - conf->login_shell = ( - strcasecmp(value, "on") == 0 || - strcasecmp(value, "true") == 0 || - strcasecmp(value, "yes") == 0) || - strtoul(value, NULL, 0) > 0; + conf->login_shell = str_to_bool(value); } else if (strcmp(key, "geometry") == 0) { |
