Changeset - r15601:4a167136fc6b
[Not reviewed]
master
0 1 0
yexo - 14 years ago 2010-08-01 10:42:18
yexo@openttd.org
(svn r20274) -Fix: special keycodes were matched if a code matched the start of the string (ie 'C' matched 'CTRL')
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/hotkeys.cpp
Show inline comments
 
@@ -67,13 +67,13 @@ static const KeycodeNames _keycode_to_na
 
static uint16 ParseCode(const char *start, const char *end)
 
{
 
	assert(start <= end);
 
	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;
 
		}
 
	}
 
	if (end - start == 1) {
 
		if (*start >= 'a' && *start <= 'z') return *start - ('a' - 'A');
 
		return *start;
0 comments (0 inline, 0 general)