summaryrefslogtreecommitdiffstats
authortcunha <tcunha>2011-01-22 22:31:09 (GMT)
committer tcunha <tcunha>2011-01-22 22:31:09 (GMT)
commitb67bfd382d3401de572bb3487b1af3382a9cbeda (patch) (side-by-side diff)
tree3ee57671bf5d57aec6c8ebc7530e23e01992f7ae
parent5ab87671e3436ef3e6f41dfc366d2c9553ffdcb2 (diff)
parente2b910a9859594ff58ad24d3d80f98c3edbecc30 (diff)
downloadtmux-old-b67bfd382d3401de572bb3487b1af3382a9cbeda.zip
tmux-old-b67bfd382d3401de572bb3487b1af3382a9cbeda.tar.gz
tmux-old-b67bfd382d3401de572bb3487b1af3382a9cbeda.tar.bz2
cvsimport
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--key-string.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/key-string.c b/key-string.c
index 1418a71..ffdd6be 100644
--- a/key-string.c
+++ b/key-string.c
@@ -1,4 +1,4 @@
-/* $Id: key-string.c,v 1.35 2011/01/03 23:32:04 tcunha Exp $ */
+/* $Id: key-string.c,v 1.36 2011/01/22 22:31:09 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <[email protected]>
@@ -147,7 +147,7 @@ key_string_lookup_string(const char *string)
/* Is this a standard ASCII key? */
if (string[1] == '\0') {
key = (u_char) string[0];
- if (key < 32 || key > 126)
+ if (key < 32 || key == 127 || key > 255)
return (KEYC_NONE);
} else {
/* Otherwise look the key up in the table. */
@@ -213,7 +213,7 @@ key_string_lookup_key(int key)
}
/* Invalid keys are errors. */
- if (key >= 127)
+ if (key == 127 || key > 255)
return (NULL);
/* Check for standard or control key. */
@@ -225,7 +225,9 @@ key_string_lookup_key(int key)
} else if (key >= 32 && key <= 126) {
tmp[0] = key;
tmp[1] = '\0';
- }
+ } else if (key >= 128)
+ xsnprintf(tmp, sizeof tmp, "\\%o", key);
+
strlcat(out, tmp, sizeof out);
return (out);
}