From 7f636587098593c6c0efd3feaecb970aa7170116 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Wed, 27 Mar 2013 11:24:18 +0000 Subject: Add TMUX_TMPDIR variable to put the socket directory outside TMPDIR. From Ben Boeckel. --- tmux.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'tmux.c') diff --git a/tmux.c b/tmux.c index 368562f8..1f4057dc 100644 --- a/tmux.c +++ b/tmux.c @@ -164,10 +164,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,15 +246,10 @@ main(int argc, char **argv) quiet = flags = 0; label = path = NULL; login_shell = (**argv == '-'); - while ((opt = getopt(argc, argv, "28c:Cdf:lL:qS:uUv")) != -1) { + while ((opt = getopt(argc, argv, "2c:Cdf:lL:qS:uUv")) != -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); -- cgit v1.2.3 From 7f9b225cc269211b86a4c4d2168146c217d63118 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Thu, 11 Apr 2013 21:52:18 +0000 Subject: Call setlocale(LC_TIME) at startup. --- tmux.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tmux.c') diff --git a/tmux.c b/tmux.c index 1f4057dc..e9b28d7e 100644 --- a/tmux.c +++ b/tmux.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -243,6 +244,8 @@ main(int argc, char **argv) malloc_options = (char *) "AFGJPX"; #endif + setlocale(LC_TIME, ""); + quiet = flags = 0; label = path = NULL; login_shell = (**argv == '-'); -- cgit v1.2.3