=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/tmux.c,v retrieving revision 1.141 retrieving revision 1.142 diff -c -r1.141 -r1.142 *** src/usr.bin/tmux/tmux.c 2015/08/30 22:56:36 1.141 --- src/usr.bin/tmux/tmux.c 2015/09/01 10:10:59 1.142 *************** *** 1,4 **** ! /* $OpenBSD: tmux.c,v 1.141 2015/08/30 22:56:36 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: tmux.c,v 1.142 2015/09/01 10:10:59 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 41,47 **** struct options global_w_options; /* window options */ struct environ global_environ; - char *cfg_file; char *shell_cmd; int debug_level; time_t start_time; --- 41,46 ---- *************** *** 171,179 **** const char * find_home(void) { ! struct passwd *pw; ! const char *home; home = getenv("HOME"); if (home == NULL || *home == '\0') { pw = getpwuid(getuid()); --- 170,181 ---- const char * find_home(void) { ! struct passwd *pw; ! static const char *home; + if (home != NULL) + return (home); + home = getenv("HOME"); if (home == NULL || *home == '\0') { pw = getpwuid(getuid()); *************** *** 189,197 **** int main(int argc, char **argv) { ! char *s, *path, *label, **var, tmp[PATH_MAX]; ! const char *home; ! int opt, flags, keys; #ifdef DEBUG malloc_options = (char *) "AFGJPX"; --- 191,198 ---- int main(int argc, char **argv) { ! char *s, *path, *label, **var, tmp[PATH_MAX]; ! int opt, flags, keys; #ifdef DEBUG malloc_options = (char *) "AFGJPX"; *************** *** 221,228 **** flags |= CLIENT_CONTROL; break; case 'f': ! free(cfg_file); ! cfg_file = xstrdup(optarg); break; case 'l': flags |= CLIENT_LOGIN; --- 222,228 ---- flags |= CLIENT_CONTROL; break; case 'f': ! set_cfg_file(optarg); break; case 'l': flags |= CLIENT_LOGIN; *************** *** 304,321 **** keys = MODEKEY_EMACS; options_set_number(&global_s_options, "status-keys", keys); options_set_number(&global_w_options, "mode-keys", keys); - } - - /* Locate the configuration file. */ - if (cfg_file == NULL) { - home = find_home(); - if (home != NULL) { - xasprintf(&cfg_file, "%s/.tmux.conf", home); - if (access(cfg_file, R_OK) != 0 && errno == ENOENT) { - free(cfg_file); - cfg_file = NULL; - } - } } /* --- 304,309 ----