Fix kiconv on the 64bit plathomes.
- Correct idxp pointer to point the properly address of the each array of the kiconv character conversion tables, so that character conversion work properly when file systems are mounted with kiconv options. - The definition of ICONV_CSMAXDATALEN was also bogus because it was defined as if all machines were 32bit computers. Tested on: amd64 MFC after: 1 month
This commit is contained in:
parent
5c86e3c106
commit
bf8ba9ab3a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=146573
@ -57,16 +57,16 @@ iconv_xlat16_open(struct iconv_converter_class *dcp,
|
||||
struct iconv_cspair *csp, struct iconv_cspair *cspf, void **dpp)
|
||||
{
|
||||
struct iconv_xlat16 *dp;
|
||||
uint32_t *headp, *idxp, dist = 0;
|
||||
uint32_t *headp, **idxp;
|
||||
int i;
|
||||
|
||||
dp = (struct iconv_xlat16 *)kobj_create((struct kobj_class*)dcp, M_ICONV, M_WAITOK);
|
||||
headp = idxp = (uint32_t *)csp->cp_data;
|
||||
dist = 0x200;
|
||||
headp = (uint32_t *)((caddr_t)csp->cp_data + sizeof(dp->d_table));
|
||||
idxp = (uint32_t **)csp->cp_data;
|
||||
for (i = 0 ; i < 0x200 ; i++) {
|
||||
if (*idxp) {
|
||||
dp->d_table[i] = headp + dist;
|
||||
dist += 0x80;
|
||||
dp->d_table[i] = headp;
|
||||
headp += 0x80;
|
||||
} else {
|
||||
dp->d_table[i] = NULL;
|
||||
}
|
||||
|
@ -36,7 +36,8 @@
|
||||
|
||||
#define ICONV_CSNMAXLEN 31 /* maximum length of charset name */
|
||||
#define ICONV_CNVNMAXLEN 31 /* maximum length of converter name */
|
||||
#define ICONV_CSMAXDATALEN (2048+262144) /* maximum size of data associated with cs pair */
|
||||
/* maximum size of data associated with cs pair */
|
||||
#define ICONV_CSMAXDATALEN (sizeof(caddr_t) * 0x200 + sizeof(uint32_t) * 0x200 * 0x80)
|
||||
|
||||
#define XLAT16_ACCEPT_NULL_OUT 0x01000000
|
||||
#define XLAT16_ACCEPT_NULL_IN 0x02000000
|
||||
|
Loading…
Reference in New Issue
Block a user