summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2020-05-20 07:11:45 +0000
committernicm <nicm@openbsd.org>2020-05-20 07:11:45 +0000
commit7610b3095b4ef5fb73bbfa471b1f5bfd7fc02ec1 (patch)
tree8cbed271f092077e73a95305adad3d3f810e216b
parentMake sure that we add our OpenBSD specific defines on PowerPC64 targets. (diff)
downloadwireguard-openbsd-7610b3095b4ef5fb73bbfa471b1f5bfd7fc02ec1.tar.xz
wireguard-openbsd-7610b3095b4ef5fb73bbfa471b1f5bfd7fc02ec1.zip
Fix a couple more places where the key flags need to be masked off.
-rw-r--r--usr.bin/tmux/key-bindings.c4
-rw-r--r--usr.bin/tmux/key-string.c6
2 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/tmux/key-bindings.c b/usr.bin/tmux/key-bindings.c
index dae15398c1b..1c2cc0b2eb6 100644
--- a/usr.bin/tmux/key-bindings.c
+++ b/usr.bin/tmux/key-bindings.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: key-bindings.c,v 1.127 2020/05/16 16:35:13 nicm Exp $ */
+/* $OpenBSD: key-bindings.c,v 1.128 2020/05/20 07:11:45 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -197,7 +197,7 @@ key_bindings_add(const char *name, key_code key, const char *note, int repeat,
}
bd = xcalloc(1, sizeof *bd);
- bd->key = key;
+ bd->key = (key & ~KEYC_MASK_FLAGS);
if (note != NULL)
bd->note = xstrdup(note);
RB_INSERT(key_bindings, &table->key_bindings, bd);
diff --git a/usr.bin/tmux/key-string.c b/usr.bin/tmux/key-string.c
index d3713774dc3..548f32de04f 100644
--- a/usr.bin/tmux/key-string.c
+++ b/usr.bin/tmux/key-string.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: key-string.c,v 1.59 2020/05/20 06:13:09 nicm Exp $ */
+/* $OpenBSD: key-string.c,v 1.60 2020/05/20 07:11:45 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -339,7 +339,7 @@ key_string_lookup_key(key_code key, int with_flags)
/* Try the key against the string table. */
for (i = 0; i < nitems(key_string_table); i++) {
- if (key == key_string_table[i].key)
+ if (key == (key_string_table[i].key & KEYC_MASK_KEY))
break;
}
if (i != nitems(key_string_table)) {
@@ -359,7 +359,7 @@ key_string_lookup_key(key_code key, int with_flags)
/* Invalid keys are errors. */
if (key > 255) {
- snprintf(out, sizeof out, "Invalid#%llx", key);
+ snprintf(out, sizeof out, "Invalid#%llx", saved);
goto out;
}