From: Ran Benita Date: Fri, 21 Sep 2012 22:30:01 +0000 (+0300) Subject: symbols: disallow changing global defaults from within a key statement X-Git-Tag: xkbcommon-0.2.0~105 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a12b5f6224cfc728f11afe2d30906fa06b771b28;p=platform%2Fupstream%2Flibxkbcommon.git symbols: disallow changing global defaults from within a key statement Pretty much like e5fdbcbb9943e9fe, again it isn't used. Signed-off-by: Ran Benita --- diff --git a/src/xkbcomp/symbols.c b/src/xkbcomp/symbols.c index e17dcfb..91feea0 100644 --- a/src/xkbcomp/symbols.c +++ b/src/xkbcomp/symbols.c @@ -1037,7 +1037,7 @@ SetGroupName(SymbolsInfo *info, ExprDef *arrayNdx, ExprDef *value) } static int -HandleSymbolsVar(SymbolsInfo *info, VarDef *stmt) +HandleGlobalVar(SymbolsInfo *info, VarDef *stmt) { const char *elem, *field; ExprDef *arrayNdx; @@ -1095,7 +1095,9 @@ HandleSymbolsBody(SymbolsInfo *info, VarDef *def, KeyInfo *keyi) for (; def; def = (VarDef *) def->common.next) { if (def->name && def->name->op == EXPR_FIELD_REF) { - ok = HandleSymbolsVar(info, def); + log_err(info->keymap->ctx, + "Cannot set a global default value from within a key statement; " + "Move statements to the global file scope\n"); continue; } @@ -1240,7 +1242,7 @@ HandleSymbolsFile(SymbolsInfo *info, XkbFile *file, enum merge_mode merge) ok = HandleSymbolsDef(info, (SymbolsDef *) stmt); break; case STMT_VAR: - ok = HandleSymbolsVar(info, (VarDef *) stmt); + ok = HandleGlobalVar(info, (VarDef *) stmt); break; case STMT_VMOD: ok = HandleVModDef((VModDef *) stmt, info->keymap, merge,