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