Commit b6a38ce5 authored by Christoph Mallon's avatar Christoph Mallon
Browse files

debugger: Remove 'firm_strncaseequal()' from debug keyword recognition.

Now only e.g. 'setmask' works, but 'SetMAsK' does not anymore.
I think, the loss is acceptable.
parent 4075c542
......@@ -840,22 +840,6 @@ static void get_text(void)
lexer.len = len;
}
/**
* Simple custom strncasecmp variant to avoid posix strings.h inclusion.
*/
static bool firm_strncaseequal(const char *str0, const char *str1, size_t len)
{
for (size_t i = 0; i < len; ++i) {
unsigned char const c0 = str0[i];
unsigned char const c1 = str1[i];
if (toupper(c0) != toupper(c1))
return false;
if (c0 == '\0')
break;
}
return true;
}
/**
* The lexer.
*/
......@@ -881,7 +865,7 @@ static unsigned get_token(void)
--len;
}
for (size_t i = ARRAY_SIZE(reserved); i-- != 0;) {
if (firm_strncaseequal(tok_start, reserved[i], len)
if (strncmp(tok_start, reserved[i], len) == 0
&& reserved[i][len] == '\0')
return first_token + i;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment