mklatin: fix compose sequences starting with a space char (␣ and ı)

This commit is contained in:
Sigrid Solveig Haflínudóttir 2021-11-14 20:16:30 +00:00
parent 45a25abc3e
commit 78b55b64c8

View file

@ -158,6 +158,7 @@ readfile(char *fname)
char *seq; char *seq;
int inseq; int inseq;
int lineno; int lineno;
int len;
Rune r; Rune r;
if((b = Bopen(fname, OREAD)) == 0) { if((b = Bopen(fname, OREAD)) == 0) {
@ -168,18 +169,19 @@ readfile(char *fname)
lineno = 0; lineno = 0;
while((line = Brdline(b, '\n')) != 0) { while((line = Brdline(b, '\n')) != 0) {
lineno++; lineno++;
if(line[0] == '#') len = Blinelen(b) - 1;
if(len < 1 || line[0] == '#')
continue; continue;
r = strtol(line, nil, 16); p = line + len;
p = strchr(line, ' '); r = strtol(line, &p, 16);
if(r == 0 || p == 0) { if(r == 0 || *p != ' ' || len < 21) {
fprint(2, "%s:%d: cannot parse line\n", fname, lineno); fprint(2, "%s:%d: cannot parse line\n", fname, lineno);
continue; continue;
} }
while(*p == ' ') line[len] = 0;
p++; p = line + 6;
/* 00AE Or rO ® registered trade mark sign */ /* 00AE Or rO ® registered trade mark sign */
for(inseq=1, seq=p; (uchar)*p < Runeself; p++) { for(inseq=1, seq=p; (uchar)*p < Runeself; p++) {
if(*p == '\0' || isspace(*p)) { if(*p == '\0' || isspace(*p)) {