Discard too long lines in dictionary file
This commit is contained in:
parent
a8d50da0cc
commit
94a15dfc4e
18
hyphen.c
18
hyphen.c
|
@ -438,11 +438,21 @@ 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);
|
||||
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…
Reference in New Issue