From 571ef024e3f3a472116a55a8489d77eb4f5f933e Mon Sep 17 00:00:00 2001 From: fjoe Date: Fri, 26 Sep 2003 20:26:25 +0000 Subject: - Support for multibyte charsets in LIBICONV. - CD9660_ICONV, NTFS_ICONV and MSDOSFS_ICONV kernel options (with corresponding modules). - kiconv(3) for loadable charset conversion tables support. Submitted by: Ryuichiro Imura --- sys/fs/ntfs/ntfs_vnops.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'sys/fs/ntfs/ntfs_vnops.c') diff --git a/sys/fs/ntfs/ntfs_vnops.c b/sys/fs/ntfs/ntfs_vnops.c index c24c9bf..4333c36 100644 --- a/sys/fs/ntfs/ntfs_vnops.c +++ b/sys/fs/ntfs/ntfs_vnops.c @@ -495,7 +495,8 @@ ntfs_readdir(ap) register struct ntnode *ip = FTONT(fp); struct uio *uio = ap->a_uio; struct ntfsmount *ntmp = ip->i_mp; - int i, error = 0; + int i, j, error = 0; + wchar c; u_int32_t faked = 0, num; int ncookies = 0; struct dirent cde; @@ -552,14 +553,17 @@ ntfs_readdir(ap) if(!ntfs_isnamepermitted(ntmp,iep)) continue; - for(i=0; iie_fnamelen; i++) { - cde.d_name[i] = NTFS_U28(iep->ie_fname[i]); + for(i=0, j=0; iie_fnamelen; i++, j++) { + c = NTFS_U28(iep->ie_fname[i]); + if (c&0xFF00) + cde.d_name[j++] = (char)(c>>8); + cde.d_name[j] = (char)c&0xFF; } - cde.d_name[i] = '\0'; + cde.d_name[j] = '\0'; dprintf(("ntfs_readdir: elem: %d, fname:[%s] type: %d, flag: %d, ", num, cde.d_name, iep->ie_fnametype, iep->ie_flag)); - cde.d_namlen = iep->ie_fnamelen; + cde.d_namlen = j; cde.d_fileno = iep->ie_number; cde.d_type = (iep->ie_fflag & NTFS_FFLAG_DIR) ? DT_DIR : DT_REG; cde.d_reclen = sizeof(struct dirent); -- cgit v1.1