Compose: Fix UTF-8 BOM detection

The leading UTF-8 BOM detection code is misplaced as it is executed
after each EOL.

Fixed by moving the code before the goto labels.
master
Pierre Le Marre 2023-10-30 12:31:42 +01:00 committed by Wismill
parent 9e88718080
commit 6c54681fe7
1 changed files with 4 additions and 4 deletions

View File

@ -527,6 +527,10 @@ parse(struct xkb_compose_table *table, struct scanner *s,
enum { MAX_ERRORS = 10 }; enum { MAX_ERRORS = 10 };
int num_errors = 0; int num_errors = 0;
/* Skip UTF-8 encoded BOM (U+FEFF) */
/* See: https://www.unicode.org/faq/utf_bom.html#bom5 */
scanner_str(s, "\xef\xbb\xbf", 3);
initial: initial:
production.len = 0; production.len = 0;
production.has_keysym = false; production.has_keysym = false;
@ -534,10 +538,6 @@ initial:
production.mods = 0; production.mods = 0;
production.modmask = 0; production.modmask = 0;
/* Skip UTF-8 encoded BOM (U+FEFF) */
/* See: https://www.unicode.org/faq/utf_bom.html#bom5 */
scanner_str(s, "\xef\xbb\xbf", 3);
/* fallthrough */ /* fallthrough */
initial_eol: initial_eol: