Changeset - r15600:240674317399
[Not reviewed]
master
0 1 0
yexo - 14 years ago 2010-07-31 23:33:09
yexo@openttd.org
(svn r20273) -Fix [FS#3930]: '-' and '=' were not correctly read from hotkeys.cfg
1 file changed with 4 insertions and 4 deletions:
0 comments (0 inline, 0 general)
src/hotkeys.cpp
Show inline comments
 
@@ -66,21 +66,21 @@ 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--;
 
	if (end - start == 1) {
 
		if (*start >= 'a' && *start <= 'z') return *start - ('a' - 'A');
 
		return *start;
 
	}
 
	for (uint i = 0; i < lengthof(_keycode_to_name); i++) {
 
		if (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;
 
	}
 
	return 0;
 
}
 

	
 
/**
 
 * Parse a string representation of a keycode.
 
 * @param start Start of the input.
0 comments (0 inline, 0 general)