aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-03-12 16:19:54 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-03-12 16:19:54 +0000
commit6657573866c99a37093049168bd992277b8c16f6 (patch)
tree7d460285b012423e0062439a9b2325c36a055b1a
parentconfig: key-bindings: verify key combo isn't already mapped to another action (diff)
parentquirks: weston_csd_{on,off}: don't do anything in fullscreen mode (diff)
Merge branch 'master' into bindings
-rw-r--r--config.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/config.c b/config.c
index bd237604..dacd2b28 100644
--- a/config.c
+++ b/config.c
@@ -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) {