# HG changeset patch # User yexo # Date 2010-08-01 10:42:18 # Node ID 4a167136fc6b9d52ee232497021f41944f1d96fd # Parent 240674317399a7a2adfcdd1e6a3f122b5b10f2c8 (svn r20274) -Fix: special keycodes were matched if a code matched the start of the string (ie 'C' matched 'CTRL') diff --git a/src/hotkeys.cpp b/src/hotkeys.cpp --- a/src/hotkeys.cpp +++ b/src/hotkeys.cpp @@ -70,7 +70,7 @@ static uint16 ParseCode(const char *star while (start < end && *start == ' ') start++; while (end > start && *end == ' ') end--; for (uint i = 0; i < lengthof(_keycode_to_name); i++) { - if (strncasecmp(start, _keycode_to_name[i].name, end - start) == 0) { + if (strlen(_keycode_to_name[i].name) == end - start && strncasecmp(start, _keycode_to_name[i].name, end - start) == 0) { return _keycode_to_name[i].keycode; } }