summaryrefslogtreecommitdiff
path: root/src/xkbcomp
diff options
context:
space:
mode:
authorRan Benita <ran234@gmail.com>2013-08-01 23:09:46 +0300
committerRan Benita <ran234@gmail.com>2013-08-02 11:40:27 +0300
commite91d2653dd18e6dcace8923596c1f1a29bb9d1d4 (patch)
tree21e30277f51e22c6287dacffbe89bf21abd13633 /src/xkbcomp
parente731b2514b96fcf92513c3f680a84666c0de3173 (diff)
downloadlibxkbcommon-e91d2653dd18e6dcace8923596c1f1a29bb9d1d4.tar.gz
libxkbcommon-e91d2653dd18e6dcace8923596c1f1a29bb9d1d4.tar.bz2
libxkbcommon-e91d2653dd18e6dcace8923596c1f1a29bb9d1d4.zip
scanner: allow empty key name literals
Some keymaps actually have this, like the quartz.xkb which is tested. We need to support these. https://bugs.freedesktop.org/show_bug.cgi?id=67654 Reported-By: Gatis Paeglis <gatis.paeglis@digia.com> Signed-off-by: Ran Benita <ran234@gmail.com>
Diffstat (limited to 'src/xkbcomp')
-rw-r--r--src/xkbcomp/scanner.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/xkbcomp/scanner.c b/src/xkbcomp/scanner.c
index 0296c58..dcd7468 100644
--- a/src/xkbcomp/scanner.c
+++ b/src/xkbcomp/scanner.c
@@ -121,10 +121,9 @@ skip_more_whitespace_and_comments:
if (chr(s, '<')) {
while (isgraph(peek(s)) && peek(s) != '>')
buf_append(s, next(s));
- if (s->buf_pos == 0)
- return scanner_error(yylloc, s, "empty key name literal");
if (!buf_append(s, '\0') || !chr(s, '>'))
return scanner_error(yylloc, s, "unterminated key name literal");
+ /* Empty key name literals are allowed. */
yylval->sval = xkb_atom_intern(s->ctx, s->buf, s->buf_pos - 1);
return KEYNAME;
}