void platform_get_x11_auth(struct X11Display *disp, const Config *cfg) { char *xauthfile; int needs_free; /* * Find the .Xauthority file. */ needs_free = FALSE; xauthfile = getenv("XAUTHORITY"); if (!xauthfile) { xauthfile = getenv("HOME"); if (xauthfile) { xauthfile = dupcat(xauthfile, "/.Xauthority", NULL); needs_free = TRUE; } } if (xauthfile) { x11_get_auth_from_authfile(disp, xauthfile); if (needs_free) sfree(xauthfile); } }
void platform_get_x11_auth(struct X11Display *disp, Conf *conf) { char *xauthfile; bool needs_free; /* * Find the .Xauthority file. */ needs_free = false; xauthfile = getenv("XAUTHORITY"); if (!xauthfile) { xauthfile = getenv("HOME"); if (xauthfile) { xauthfile = dupcat(xauthfile, "/.Xauthority", NULL); needs_free = true; } } if (xauthfile) { x11_get_auth_from_authfile(disp, xauthfile); if (needs_free) sfree(xauthfile); } }
void platform_get_x11_auth(struct X11Display *disp, Conf *conf) { char *xauthpath = conf_get_filename(conf, CONF_xauthfile)->path; if (xauthpath[0]) x11_get_auth_from_authfile(disp, xauthpath); }
void platform_get_x11_auth(struct X11Display *disp, const Config *cfg) { if (cfg->xauthfile.path[0]) x11_get_auth_from_authfile(disp, cfg->xauthfile.path); }