From 119bed3cf0313cb028627872f7f85a232019991d Mon Sep 17 00:00:00 2001 From: okan Date: Thu, 7 Dec 2017 15:47:14 +0000 Subject: stash dir into conf since it'll be of use --- calmwm.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'calmwm.c') diff --git a/calmwm.c b/calmwm.c index 5a6e43c..c22f0fa 100644 --- a/calmwm.c +++ b/calmwm.c @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: calmwm.c,v 1.99 2016/10/18 17:03:30 okan Exp $ + * $OpenBSD: calmwm.c,v 1.100 2017/12/07 15:47:14 okan Exp $ */ #include @@ -42,7 +42,6 @@ Atom cwmh[CWMH_NITEMS]; Atom ewmh[EWMH_NITEMS]; struct screen_q Screenq = TAILQ_HEAD_INITIALIZER(Screenq); struct conf Conf; -const char *homedir; volatile sig_atomic_t cwm_status; static void sighdlr(int); @@ -82,16 +81,16 @@ main(int argc, char **argv) if (signal(SIGCHLD, sighdlr) == SIG_ERR) err(1, "signal"); - if ((homedir = getenv("HOME")) == NULL || *homedir == '\0') { + if ((Conf.homedir = getenv("HOME")) == NULL || Conf.homedir[0] == '\0') { pw = getpwuid(getuid()); if (pw != NULL && pw->pw_dir != NULL && *pw->pw_dir != '\0') - homedir = pw->pw_dir; + Conf.homedir = pw->pw_dir; else - homedir = "/"; + Conf.homedir = "/"; } if (conf_file == NULL) - xasprintf(&conf_path, "%s/%s", homedir, CONFFILE); + xasprintf(&conf_path, "%s/%s", Conf.homedir, CONFFILE); else conf_path = xstrdup(conf_file); -- cgit v1.2.3-2-gb3c3