From bafc8e0f241ca51bded06aad2b393091b00c5dd2 Mon Sep 17 00:00:00 2001 From: Juho Hiltunen Date: Sat, 30 Jun 2018 14:50:27 +0300 Subject: [PATCH] Emoji: skip multi-word replacements. Fixes #511. --- src/libespeak-ng/translate.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/libespeak-ng/translate.c b/src/libespeak-ng/translate.c index cb4ba944..24bcb59a 100644 --- a/src/libespeak-ng/translate.c +++ b/src/libespeak-ng/translate.c @@ -1194,9 +1194,11 @@ int TranslateWord(Translator *tr, char *word_start, WORD_TAB *wtab, char *word_o available -= n; phonemes += n; - // skip to the next word in a multi-word replacement - while (!isspace(*word_out)) ++word_out; - while (isspace(*word_out)) ++word_out; + // skip to the next word in a multi-word replacement. Always skip at least one word. + for (dictionary_skipwords++; dictionary_skipwords > 0; dictionary_skipwords--) { + while (!isspace(*word_out)) ++word_out; + while (isspace(*word_out)) ++word_out; + } } // If the list file contains a text replacement to another