=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cfg.c,v retrieving revision 1.44 retrieving revision 1.45 diff -c -r1.44 -r1.45 *** src/usr.bin/tmux/cfg.c 2016/01/19 15:59:12 1.44 --- src/usr.bin/tmux/cfg.c 2016/05/12 16:05:33 1.45 *************** *** 1,4 **** ! /* $OpenBSD: cfg.c,v 1.44 2016/01/19 15:59:12 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: cfg.c,v 1.45 2016/05/12 16:05:33 tim Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott *************** *** 48,55 **** void start_cfg(void) { - char *cause = NULL; const char *home; cfg_cmd_q = cmdq_new(NULL); cfg_cmd_q->emptyfn = cfg_default_done; --- 48,55 ---- void start_cfg(void) { const char *home; + int quiet = 0; cfg_cmd_q = cmdq_new(NULL); cfg_cmd_q->emptyfn = cfg_default_done; *************** *** 61,88 **** if (cfg_client != NULL) cfg_client->references++; ! if (access(TMUX_CONF, R_OK) == 0) { ! if (load_cfg(TMUX_CONF, cfg_cmd_q, &cause) == -1) ! cfg_add_cause("%s: %s", TMUX_CONF, cause); ! } else if (errno != ENOENT) ! cfg_add_cause("%s: %s", TMUX_CONF, strerror(errno)); if (cfg_file == NULL && (home = find_home()) != NULL) { xasprintf(&cfg_file, "%s/.tmux.conf", home); ! if (access(cfg_file, R_OK) != 0 && errno == ENOENT) { ! free(cfg_file); ! cfg_file = NULL; ! } } ! if (cfg_file != NULL && load_cfg(cfg_file, cfg_cmd_q, &cause) == -1) ! cfg_add_cause("%s: %s", cfg_file, cause); ! free(cause); cmdq_continue(cfg_cmd_q); } int ! load_cfg(const char *path, struct cmd_q *cmdq, char **cause) { FILE *f; char delim[3] = { '\\', '\\', '\0' }; --- 61,80 ---- if (cfg_client != NULL) cfg_client->references++; ! load_cfg(TMUX_CONF, cfg_cmd_q, 1); if (cfg_file == NULL && (home = find_home()) != NULL) { xasprintf(&cfg_file, "%s/.tmux.conf", home); ! quiet = 1; } ! if (cfg_file != NULL) ! load_cfg(cfg_file, cfg_cmd_q, quiet); cmdq_continue(cfg_cmd_q); } int ! load_cfg(const char *path, struct cmd_q *cmdq, int quiet) { FILE *f; char delim[3] = { '\\', '\\', '\0' }; *************** *** 93,99 **** log_debug("loading %s", path); if ((f = fopen(path, "rb")) == NULL) { ! xasprintf(cause, "%s: %s", path, strerror(errno)); return (-1); } --- 85,93 ---- log_debug("loading %s", path); if ((f = fopen(path, "rb")) == NULL) { ! if (errno == ENOENT && quiet) ! return (0); ! cfg_add_cause("%s: %s", path, strerror(errno)); return (-1); }