GNOME Bugzilla – Bug 104862
gtkimcontextsimple.c compose table is not completely sorted
Last modified: 2011-02-04 16:11:59 UTC
Hello, In gtkimcontextsimple.c, it appears that the table of compose sequences needs to be sorted, since it is passed to bsearch() at some point. However, there are a few spots that this is not the case, so this might create problems. I've written some simple code that can be appended to the file, which creates an autonomous executable that prints the table and checks that it is in ascending order. Using said code, I've corrected all problematic spots, and created a patch. I'm going to submit both as attachments to this bug report. The code is used as follows: it prints out all entries from the compose tables, and prints "not sorted!" for each entry that isn't greater than its previous one (it also prints it for the first entry, because it's compared with itself, so don't worry about that). It should be fairly straightforward. Note that I'm not really sending this for inclusion; just in case someone wants to perform this check in the future. Thanks, Vasilis
Created attachment 13971 [details] [review] patch that corrects the order of elements for the compose table
Created attachment 13972 [details] code that can check the compose table for ascending order
A patch looks good, except: - GDK_Multi_key, GDK_t, GDK_less, 0, 0, 0x0165, /* LATIN_SMALL_LETTER_T_WITH_CARON */ + GDK_Multi_key, GDK_T, GDK_less, 0, 0, 0x0164, /* LATIN_CAPITAL_LETTER_T_WITH_CARON */ This is a different bug fix although a fix itself looks correct. Owen - okay to commit to the HEAD?
Looks good to me for gtk-2-2 and HEAD, including the T< change.
* gtk/gtkimcontextsimple.c: code that can check the compose table for ascending order, by Vasilis Vasaitis (#104862). commit to the gtk-2-2 and HEAD.