int
-keyword_to_token(const char *string)
+keyword_to_token(const char *string, unsigned int len)
{
- const struct keyword_tok *kt;
- kt = keyword_gperf_lookup(string, strlen(string));
+ const struct keyword_tok *kt = keyword_gperf_lookup(string, len);
if (!kt)
return -1;
return kt->tok;
%%
int
-keyword_to_token(const char *string)
+keyword_to_token(const char *string, unsigned int len)
{
- const struct keyword_tok *kt;
- kt = keyword_gperf_lookup(string, strlen(string));
+ const struct keyword_tok *kt = keyword_gperf_lookup(string, len);
if (!kt)
return -1;
return kt->tok;
parse(struct xkb_context *ctx, void *scanner, const char *map);
int
-keyword_to_token(const char *string);
+keyword_to_token(const char *string, unsigned int len);
#endif
return scanner_error(s, "identifier too long");
/* Keyword. */
- tok = keyword_to_token(s->buf);
+ tok = keyword_to_token(s->buf, s->buf_pos - 1);
if (tok != -1) return tok;
yylval->str = strdup(s->buf);