|
|
c4524d |
From 8b11c418417d36b6f818fd52882a051977c152a1 Mon Sep 17 00:00:00 2001
|
|
|
c4524d |
From: Daniel Stone <daniels@collabora.com>
|
|
|
c4524d |
Date: Mon, 26 Jun 2017 16:45:16 +0100
|
|
|
c4524d |
Subject: [PATCH 01/10] parser: Don't set more maps when we don't have any
|
|
|
c4524d |
|
|
|
c4524d |
If the scanner indicates that we might have something which looks like a
|
|
|
c4524d |
map, but the parser in fact fails to create that map, we will try to
|
|
|
c4524d |
access the map regardless. Stop doing that.
|
|
|
c4524d |
|
|
|
c4524d |
testcase: 'xkb_keymap {' -> '#kb_keymap'
|
|
|
c4524d |
|
|
|
c4524d |
Signed-off-by: Daniel Stone <daniels@collabora.com>
|
|
|
c4524d |
(cherry picked from commit a8ea7a1d3daa7bdcb877615ae0a252c189153bd2)
|
|
|
c4524d |
---
|
|
|
c4524d |
src/xkbcomp/parser.y | 5 +++--
|
|
|
c4524d |
1 file changed, 3 insertions(+), 2 deletions(-)
|
|
|
c4524d |
|
|
|
c4524d |
diff --git a/src/xkbcomp/parser.y b/src/xkbcomp/parser.y
|
|
|
c4524d |
index 7ff6f92..b5b0c2c 100644
|
|
|
c4524d |
--- a/src/xkbcomp/parser.y
|
|
|
c4524d |
+++ b/src/xkbcomp/parser.y
|
|
|
c4524d |
@@ -239,9 +239,9 @@ resolve_keysym(const char *name, xkb_keysym_t *sym_rtrn)
|
|
|
c4524d |
*/
|
|
|
c4524d |
|
|
|
c4524d |
XkbFile : XkbCompositeMap
|
|
|
c4524d |
- { $$ = param->rtrn = $1; param->more_maps = true; }
|
|
|
c4524d |
+ { $$ = param->rtrn = $1; param->more_maps = !!param->rtrn; }
|
|
|
c4524d |
| XkbMapConfig
|
|
|
c4524d |
- { $$ = param->rtrn = $1; param->more_maps = true; YYACCEPT; }
|
|
|
c4524d |
+ { $$ = param->rtrn = $1; param->more_maps = !!param->rtrn; YYACCEPT; }
|
|
|
c4524d |
| END_OF_FILE
|
|
|
c4524d |
{ $$ = param->rtrn = NULL; param->more_maps = false; }
|
|
|
c4524d |
;
|
|
|
c4524d |
@@ -779,6 +779,7 @@ parse(struct xkb_context *ctx, struct scanner *scanner, const char *map)
|
|
|
c4524d |
.scanner = scanner,
|
|
|
c4524d |
.ctx = ctx,
|
|
|
c4524d |
.rtrn = NULL,
|
|
|
c4524d |
+ .more_maps = false,
|
|
|
c4524d |
};
|
|
|
c4524d |
|
|
|
c4524d |
/*
|
|
|
c4524d |
--
|
|
|
c4524d |
2.20.1
|