aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2020-06-27 12:01:18 +0100
committerThomas Adam <thomas@xteddy.org>2020-06-27 12:01:18 +0100
commit332aca754b96ae5f5f5dd0bb32e3d008ac735684 (patch)
tree3439e54a45fbf734ce0fce26fae9b41639437ccf
parent04a1a84bb8d3b34400b63ca9193faf405e5728d1 (diff)
parentb6aeb86c20abca3b88722da15747755f8a7690f7 (diff)
downloadrtmux-332aca754b96ae5f5f5dd0bb32e3d008ac735684.tar.gz
rtmux-332aca754b96ae5f5f5dd0bb32e3d008ac735684.tar.bz2
rtmux-332aca754b96ae5f5f5dd0bb32e3d008ac735684.zip
Merge branch 'obsd-master'
-rw-r--r--key-string.c30
-rw-r--r--screen-redraw.c8
2 files changed, 29 insertions, 9 deletions
diff --git a/key-string.c b/key-string.c
index 4ee12145..6f4fd2ac 100644
--- a/key-string.c
+++ b/key-string.c
@@ -18,7 +18,9 @@
#include <sys/types.h>
+#include <stdlib.h>
#include <string.h>
+#include <wchar.h>
#include "tmux.h"
@@ -163,13 +165,13 @@ key_code
key_string_lookup_string(const char *string)
{
static const char *other = "!#()+,-.0123456789:;<=>'\r\t";
- key_code key;
- u_int u;
- key_code modifiers;
- struct utf8_data ud;
- u_int i;
+ key_code key, modifiers;
+ u_int u, i;
+ struct utf8_data ud, *udp;
enum utf8_state more;
utf8_char uc;
+ char m[MB_LEN_MAX + 1];
+ int mlen;
/* Is this no key or any key? */
if (strcasecmp(string, "None") == 0)
@@ -181,9 +183,21 @@ key_string_lookup_string(const char *string)
if (string[0] == '0' && string[1] == 'x') {
if (sscanf(string + 2, "%x", &u) != 1)
return (KEYC_UNKNOWN);
- if (u > 0x1fffff)
- return (KEYC_UNKNOWN);
- return (u);
+ mlen = wctomb(m, u);
+ if (mlen <= 0 || mlen > MB_LEN_MAX)
+ return (KEYC_UNKNOWN);
+ m[mlen] = '\0';
+
+ udp = utf8_fromcstr(m);
+ if (udp == NULL ||
+ udp[0].size == 0 ||
+ udp[1].size != 0 ||
+ utf8_from_data(&udp[0], &uc) != UTF8_DONE) {
+ free(udp);
+ return (KEYC_UNKNOWN);
+ }
+ free(udp);
+ return (uc);
}
/* Check for modifiers. */
diff --git a/screen-redraw.c b/screen-redraw.c
index 258c2fd2..3391a891 100644
--- a/screen-redraw.c
+++ b/screen-redraw.c
@@ -271,13 +271,19 @@ screen_redraw_type_of_cell(struct client *c, u_int px, u_int py,
borders |= 2;
if (screen_redraw_cell_border(c, px, py + 1, pane_status))
borders |= 1;
- } else {
+ } else if (pane_status == PANE_STATUS_BOTTOM) {
if (py == 0 ||
screen_redraw_cell_border(c, px, py - 1, pane_status))
borders |= 2;
if (py != sy - 1 &&
screen_redraw_cell_border(c, px, py + 1, pane_status))
borders |= 1;
+ } else {
+ if (py == 0 ||
+ screen_redraw_cell_border(c, px, py - 1, pane_status))
+ borders |= 2;
+ if (screen_redraw_cell_border(c, px, py + 1, pane_status))
+ borders |= 1;
}
/*