From 5ed441c6bf89a63b61046aca69b6d7f177fb3867 Mon Sep 17 00:00:00 2001 From: Andrew Bird Date: Thu, 29 Oct 2026 23:35:08 +0000 Subject: [PATCH] NLS: Upcase function address was lost after loading country.sys After loading country.sys the Upcase function address was being zeroed out rather than updated correctly. Traced to a NEAR/FAR pointer mismatch. Discovered whilst looking for the cause of https://github.com/FDOS/kernel/issues/269 Using the Dosemu2 test suite command `test/test_dosemu.py FRDOSGITTestCase.test_get_country` Before: INFO: fmt_date = '1' INFO: sym_currency = '0x9c,0x00,0x00,0x00,0x00' INFO: sep_thousand = ',' INFO: sep_decimal = '.' INFO: sep_date = '/' INFO: sep_time = ':' INFO: fmt_currency = '0' INFO: num_curdigits = '2' INFO: fmt_time = '1' INFO: func_upcase = '0000:0000' INFO: sep_datalist = ',' After: INFO: fmt_date = '1' INFO: sym_currency = '0x9c,0x00,0x00,0x00,0x00' INFO: sep_thousand = ',' INFO: sep_decimal = '.' INFO: sep_date = '/' INFO: sep_time = ':' INFO: fmt_currency = '0' INFO: num_curdigits = '2' INFO: fmt_time = '1' INFO: func_upcase = '00D9:1338' INFO: sep_datalist = ',' INFO: upcased_char = 'B' Tested with Ia16-gcc and Watcom compilers only. --- kernel/config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/config.c b/kernel/config.c index e3470f69..fa7772f6 100644 --- a/kernel/config.c +++ b/kernel/config.c @@ -1664,7 +1664,7 @@ err:printf("%s has invalid format\n", filename); /* skip length ^*/ subf_data.length); if (hdr[i].id == 1) { /* fixup user callable address in case we overwrote it */ - ((struct CountrySpecificInfo *)ptable)->CharMapFn = CharMapFn; + ((struct CountrySpecificInfo FAR *)(ptable + 2))->CharMapFn = CharMapFn; } } }