Date: Sat, 17 Jan 2004 20:57:10 +0800 From: Liang-Heng Chen <xeon@tfcis.org> To: freebsd-questions@FreeBSD.org Subject: About contrib/smbfs/lib/smb/nls.c Message-ID: <40093126.9080606@tfcis.org>
next in thread | raw e-mail | index | archive | help
There's a problem of mount_smb when mounting a share with Chinese Big5
in its name.
statue@freebsd.sinica.edu.tw has the update with
/usr/src/contrib/smbfs/lib/smb/nls.c:
nls_str_upper(char *dst, const char *src)
{
char *p = dst;
- while (*src)
- *dst++ = toupper(*src++);
*dst = 0;
return p;
}
--- 217,236 ----
nls_str_upper(char *dst, const char *src)
{
char *p = dst;
+ int big5 = 0;
+
+ while (*src) {
+ if (big5)
+ *dst++ = *src++;
+ else
+ *dst++ = toupper(*src++);
+
+ if (!big5 && *(src - 1) < 0)
+ big5 = 1;
+ else
+ big5 = 0;
+ }
*dst = 0;
return p;
}
It seems that the original code makes all character to upper case even
if it's a part of a multi-byte word.
Would you please fix the problem?
Thanks.
Liang-Heng Chen@TW
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?40093126.9080606>
