Changeset - r15407:387627af240b
[Not reviewed]
master
0 1 0
frosch - 14 years ago 2010-07-03 15:15:19
frosch@openttd.org
(svn r20060) -Fix (r20055): strnicmp() does not exist on all platforms.
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/hotkeys.cpp
Show inline comments
 
@@ -58,25 +58,25 @@ static const KeycodeNames _keycode_to_na
 
 * @return A keycode if a match is found or 0.
 
 */
 
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 (strnicmp(start, _keycode_to_name[i].name, end - start) == 0) {
 
		if (strncasecmp(start, _keycode_to_name[i].name, end - start) == 0) {
 
			return _keycode_to_name[i].keycode;
 
		}
 
	}
 
	return 0;
 
}
 

	
 
/**
 
 * Parse a string representation of a keycode.
 
 * @param start Start of the input.
 
 * @param end End of the input.
 
 * @return A valid keycode or 0.
 
 */
0 comments (0 inline, 0 general)