diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2013-05-31 13:00:11 +0100 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2013-05-31 13:00:11 +0100 |
commit | 2ee9c4df12429d4f6fb8f06a373fdd5c0347049c (patch) | |
tree | 1c241b4bcd2e637cbae11d7fb6b34840d9839ec7 /tmux.c | |
parent | e6c77e7afbcee07ed6237f2a0f30e70f45ecf0ba (diff) | |
parent | 76cb088d16fd5aa47b54428368ef403cbbcf4f5a (diff) | |
download | rtmux-2ee9c4df12429d4f6fb8f06a373fdd5c0347049c.tar.gz rtmux-2ee9c4df12429d4f6fb8f06a373fdd5c0347049c.tar.bz2 rtmux-2ee9c4df12429d4f6fb8f06a373fdd5c0347049c.zip |
Merge branch 'master' of ssh://git.code.sf.net/p/tmux/tmux-code
Diffstat (limited to 'tmux.c')
-rw-r--r-- | tmux.c | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -22,6 +22,7 @@ #include <errno.h> #include <event.h> #include <fcntl.h> +#include <locale.h> #include <pwd.h> #include <stdlib.h> #include <string.h> @@ -167,10 +168,12 @@ makesocketpath(const char *label) u_int uid; uid = getuid(); - if ((s = getenv("TMPDIR")) == NULL || *s == '\0') - xsnprintf(base, sizeof base, "%s/tmux-%u", _PATH_TMP, uid); - else + if ((s = getenv("TMUX_TMPDIR")) != NULL && *s != '\0') + xsnprintf(base, sizeof base, "%s/", s); + else if ((s = getenv("TMPDIR")) != NULL && *s != '\0') xsnprintf(base, sizeof base, "%s/tmux-%u", s, uid); + else + xsnprintf(base, sizeof base, "%s/tmux-%u", _PATH_TMP, uid); if (mkdir(base, S_IRWXU) != 0 && errno != EEXIST) return (NULL); @@ -244,18 +247,15 @@ main(int argc, char **argv) malloc_options = (char *) "AFGJPX"; #endif + setlocale(LC_TIME, ""); + quiet = flags = 0; label = path = NULL; login_shell = (**argv == '-'); - while ((opt = getopt(argc, argv, "28c:Cdf:lL:qS:uUvV")) != -1) { + while ((opt = getopt(argc, argv, "2c:Cdf:lL:qS:uUVv")) != -1) { switch (opt) { case '2': flags |= IDENTIFY_256COLOURS; - flags &= ~IDENTIFY_88COLOURS; - break; - case '8': - flags |= IDENTIFY_88COLOURS; - flags &= ~IDENTIFY_256COLOURS; break; case 'c': free(shell_cmd); @@ -363,7 +363,7 @@ main(int argc, char **argv) if (pw != NULL) home = pw->pw_dir; } - xasprintf(&cfg_file, "%s/%s", home, DEFAULT_CFG); + xasprintf(&cfg_file, "%s/.tmux.conf", home); if (access(cfg_file, R_OK) != 0 && errno == ENOENT) { free(cfg_file); cfg_file = NULL; |