From 504fd1674645d10cac242efeca71c61e98cad14b Mon Sep 17 00:00:00 2001 From: lpproj Date: Sat, 22 Nov 2014 11:42:05 +0900 Subject: [PATCH] Enable to load DBCS table from COUNTRY.SYS --- hdr/nls.h | 5 ++++- kernel/config.c | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/hdr/nls.h b/hdr/nls.h index bc075cf..fda3336 100644 --- a/hdr/nls.h +++ b/hdr/nls.h @@ -435,7 +435,10 @@ struct nlsPackage { /* the contents of one chain item of the struct nlsDBCS { /* The internal structure is unknown to me */ UWORD numEntries; - UWORD dbcsTbl[1]; + UWORD dbcsTbl[4]; /* I don't know max size but it should need + at least 3 words (6 bytes) + ({0x81,0x9f,0xe0,0xfc,0,0} for CP932-Japan) + -- lpproj 2014/10/27 */ }; struct nlsCharTbl { diff --git a/kernel/config.c b/kernel/config.c index b3e572d..f53797f 100644 --- a/kernel/config.c +++ b/kernel/config.c @@ -1542,7 +1542,7 @@ err:printf("%s has invalid format\n", filename); { if (hdr[i].length != 6) goto err; - if (hdr[i].id < 1 || hdr[i].id > 6 || hdr[i].id == 3) + if (hdr[i].id < 1 || hdr[i].id > 7 || hdr[i].id == 3) continue; if (lseek(fd, hdr[i].offset) == 0xffffffffL || read(fd, &subf_data, 10) != 10