Browse Source

Don't print 'Bad rules data in ...' if there are no rules in the dictionary.

master
Reece H. Dunn 7 years ago
parent
commit
55d001514e
1 changed files with 5 additions and 2 deletions
  1. 5
    2
      src/libespeak-ng/dictionary.c

+ 5
- 2
src/libespeak-ng/dictionary.c View File

@@ -138,9 +138,12 @@ static void InitGroups(Translator *tr)
memset(tr->groups3, 0, sizeof(tr->groups3));

p = tr->data_dictrules;
while (*p != 0) {
// If there are no rules in the dictionary, compile_dictrules will not
// write a RULE_GROUP_START (written in the for loop), but will write
// a RULE_GROUP_END.
if (*p != RULE_GROUP_END) while (*p != 0) {
if (*p != RULE_GROUP_START) {
fprintf(stderr, "Bad rules data in '%s_dict' at 0x%x\n", dictionary_name, (unsigned int)(p - tr->data_dictrules));
fprintf(stderr, "Bad rules data in '%s_dict' at 0x%x (%c)\n", dictionary_name, (unsigned int)(p - tr->data_dictrules), p);
break;
}
p++;

Loading…
Cancel
Save