mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-05 01:40:41 -05:00
Merge branch 'master' into bindings
This commit is contained in:
commit
6657573866
1 changed files with 10 additions and 5 deletions
15
config.c
15
config.c
|
|
@ -137,6 +137,15 @@ get_config_path(void)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue