Updated core
[LibreOffice.git] / hyphen / hyphen-rhmin.patch
blob12fff19f44660e42ba23dd8001a804d8ad84ba55
1 --- misc//hyphen-2.8.4/hyphen.c
2 +++ misc/build/hyphen-2.8.4/hyphen.c
3 @@ -734,13 +734,13 @@
4 int hnj_hyphen_rhmin(int utf8, const char *word, int word_size, char * hyphens,
5 char *** rep, int ** pos, int ** cut, int rhmin)
7 - int i = 1;
8 + int i = 0;
9 int j;
11 // ignore numbers
12 for (j = word_size - 1; j > 0 && word[j] <= '9' && word[j] >= '0'; j--) i--;
14 - for (j = word_size - 2; i < rhmin && j > 0; j--) {
15 + for (j = word_size - 1; i < rhmin && j > 0; j--) {
16 // check length of the non-standard part
17 if (*rep && *pos && *cut && (*rep)[j]) {
18 char * rh = strchr((*rep)[j], '=');
19 @@ -753,7 +753,7 @@
20 } else {
21 hyphens[j] = '0';
23 - if (!utf8 || (word[j] & 0xc0) != 0xc0) i++;
24 + if (!utf8 || (word[j] & 0xc0) == 0xc0 || (word[j] & 0x80) != 0x80) i++;
26 return 0;