symbols: fix bug in symbol merging

When we merge two KeyInfo's (belonging to the same keycode), we may take
a shortcut from copying if we see that the merged keys will be exactly
like those in one of the two KeyInfo's. In the case where we take the
symbols from the KeyInfo we are *not* merging into, we need to copy
the three arrays:
    syms[group], symsMapNumEntries[group], symsMapIndex[group]
The code currently only copies the first one, so if there's a merge
conflict some levels may seem to disappear (i.e. have a NoSymbol
keysym).

This fixes the failing test added in c8d6bba.

Signed-off-by: Ran Benita <ran234@gmail.com>
master
Ran Benita 2012-07-11 21:37:59 +03:00 committed by Daniel Stone
parent 09d1445b4a
commit e4d4de8c9e
1 changed files with 6 additions and 0 deletions

View File

@ -411,6 +411,12 @@ MergeKeyGroups(SymbolsInfo * info,
if (using == FROM)
{
resultSyms = from->syms[group];
darray_free(into->symsMapNumEntries[group]);
darray_free(into->symsMapIndex[group]);
into->symsMapNumEntries[group] = from->symsMapNumEntries[group];
into->symsMapIndex[group] = from->symsMapIndex[group];
darray_init(from->symsMapNumEntries[group]);
darray_init(from->symsMapIndex[group]);
goto out;
}
else if (using == TO)