About contrib/smbfs/lib/smb/nls.c

Liang-Heng Chen xeon at tfcis.org
Sat Jan 17 04:57:20 PST 2004


There's a problem of mount_smb when mounting a share with Chinese Big5
in its name.

statue at 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 at TW



More information about the freebsd-questions mailing list