aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGustav HÃ¥llberg <gustav@gmail.com>2009-01-01 02:03:17 (GMT)
committerGustav HÃ¥llberg <gustav@gmail.com>2009-01-16 23:38:32 (GMT)
commit1d452fc1cee76b013582ad1921436612d6647ddf (patch)
tree43e0fe1b8c61d264ebb0527dd25f14ab6a4185a5
parent317cf418db598aeefa5021abb0280072d2bb1e25 (diff)
downloadpowwow-1d452fc1cee76b013582ad1921436612d6647ddf.zip
powwow-1d452fc1cee76b013582ad1921436612d6647ddf.tar.gz
powwow-1d452fc1cee76b013582ad1921436612d6647ddf.tar.bz2
disallow #rebind of key sequence which is the prefix of another sequence
-rw-r--r--cmd2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd2.c b/cmd2.c
index 83b3111..ee40ce5 100644
--- a/cmd2.c
+++ b/cmd2.c
@@ -1401,7 +1401,7 @@ void parse_rebind __P1 (char *,arg)
for (p = keydefs; p; p = p->next) {
if (p == *kp)
continue;
- if (seqlen == p->seqlen && !memcmp(p->sequence, seq, seqlen)) {
+ if (!memcmp(p->sequence, seq, MIN2(seqlen, p->seqlen))) {
show_single_bind("key already bound as:", p);
return;
}