summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2011-03-04 23:26:45 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2011-03-04 23:26:45 +0000
commit03936683f39530295504caacc7eb40399ca149e1 (patch)
treeb8ed24c1e646bfc40a44409c7d95b79e85181f56
parent9f270df5070460d48ffd2243cb98372392bf22b1 (diff)
Two fixes by Micah Cowan: make mouse work properly beyond >127 on signed
char architectures and properly parse $TMUX by stopping the socket path at the first comma.
-rw-r--r--usr.bin/tmux/tmux.c4
-rw-r--r--usr.bin/tmux/tty-keys.c6
2 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/tmux/tmux.c b/usr.bin/tmux/tmux.c
index fedc8903e4b..b12a8fbbb52 100644
--- a/usr.bin/tmux/tmux.c
+++ b/usr.bin/tmux/tmux.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tmux.c,v 1.103 2011/01/23 11:03:43 nicm Exp $ */
+/* $OpenBSD: tmux.c,v 1.104 2011/03/04 23:26:44 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -132,7 +132,7 @@ parseenvironment(void)
if ((env = getenv("TMUX")) == NULL)
return;
- if (sscanf(env, "%255s,%ld,%d", path, &pid, &idx) != 3)
+ if (sscanf(env, "%255[^,],%ld,%d", path, &pid, &idx) != 3)
return;
environ_path = xstrdup(path);
environ_pid = pid;
diff --git a/usr.bin/tmux/tty-keys.c b/usr.bin/tmux/tty-keys.c
index 390c1f69f7d..ef77241b98b 100644
--- a/usr.bin/tmux/tty-keys.c
+++ b/usr.bin/tmux/tty-keys.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty-keys.c,v 1.33 2011/01/03 23:35:22 nicm Exp $ */
+/* $OpenBSD: tty-keys.c,v 1.34 2011/03/04 23:26:44 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -630,10 +630,10 @@ tty_keys_mouse(struct tty *tty,
utf8_append(&utf8data, buf[*size]);
value = utf8_combine(&utf8data);
} else
- value = buf[*size];
+ value = (unsigned char)buf[*size];
(*size)++;
} else {
- value = buf[*size];
+ value = (unsigned char)buf[*size];
(*size)++;
}