mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-20 01:40:14 -05:00
Merge branch 'master' into bindings
This commit is contained in:
commit
fc7b3b2d85
7 changed files with 40 additions and 22 deletions
14
config.c
14
config.c
|
|
@ -413,6 +413,12 @@ parse_section_csd(const char *key, const char *value, struct config *conf,
|
|||
conf->csd.color.close_set = true;
|
||||
conf->csd.color.close = color;
|
||||
}
|
||||
|
||||
else {
|
||||
LOG_WARN("%s:%u: invalid key: %s", path, lineno, key);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -561,12 +567,16 @@ err:
|
|||
static char *
|
||||
get_server_socket_path(void)
|
||||
{
|
||||
const char *xdg_session_id = getenv("XDG_SESSION_ID");
|
||||
const char *xdg_runtime = getenv("XDG_RUNTIME_DIR");
|
||||
if (xdg_runtime == NULL)
|
||||
return strdup("/tmp/foot.sock");
|
||||
|
||||
char *path = malloc(strlen(xdg_runtime) + 1 + strlen("foot.sock") + 1);
|
||||
sprintf(path, "%s/foot.sock", xdg_runtime);
|
||||
if (xdg_session_id == NULL)
|
||||
xdg_session_id = "<no-session>";
|
||||
|
||||
char *path = malloc(strlen(xdg_runtime) + 1 + strlen("foot-.sock") + strlen(xdg_session_id) + 1);
|
||||
sprintf(path, "%s/foot-%s.sock", xdg_runtime, xdg_session_id);
|
||||
return path;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue