mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-05 23:38:38 +09:00
Merge libhyphen fix from upstream.
This commit is contained in:
parent
f6fa2effca
commit
abd21e76ce
1 changed files with 18 additions and 4 deletions
|
|
@ -438,11 +438,25 @@ for (k = 0; k < 2; k++) {
|
|||
}
|
||||
|
||||
if (k == 0 || nextlevel) {
|
||||
while (fgets (buf, sizeof(buf), f) != NULL) {
|
||||
while (fgets(buf, sizeof(buf), f) != NULL) {
|
||||
|
||||
/* discard lines that don't fit in buffer */
|
||||
if (!feof(f) && strchr(buf, '\n') == NULL) {
|
||||
int c;
|
||||
while ((c = fgetc(f)) != '\n' && c != EOF);
|
||||
/* issue warning if not a comment */
|
||||
if (buf[0] != '%') {
|
||||
fprintf(stderr, "Warning: skipping too long pattern (more than %lu chars)\n", sizeof(buf));
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (strncmp(buf, "NEXTLEVEL", 9) == 0) {
|
||||
nextlevel = 1;
|
||||
break;
|
||||
} else if (buf[0] != '%') hnj_hyphen_load_line(buf, dict[k], hashtab);
|
||||
nextlevel = 1;
|
||||
break;
|
||||
} else if (buf[0] != '%') {
|
||||
hnj_hyphen_load_line(buf, dict[k], hashtab);
|
||||
}
|
||||
}
|
||||
} else if (k == 1) {
|
||||
/* default first level: hyphen and ASCII apostrophe */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue