From owner-freebsd-questions@FreeBSD.ORG Sat Jan 17 04:57:20 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0570516A4CE for ; Sat, 17 Jan 2004 04:57:20 -0800 (PST) Received: from mail.nsysu.edu.tw (mail.nsysu.edu.tw [140.117.11.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id F344E43D31 for ; Sat, 17 Jan 2004 04:57:18 -0800 (PST) (envelope-from xeon@tfcis.org) Received: from tfcis.org (xeon.tfcis.org [140.117.190.79]) by mail.nsysu.edu.tw (Postfix) with ESMTP id 402B5901B8 for ; Sat, 17 Jan 2004 20:50:36 +0800 (CST) Message-ID: <40093126.9080606@tfcis.org> Date: Sat, 17 Jan 2004 20:57:10 +0800 From: Liang-Heng Chen User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; zh-TW; rv:1.5) Gecko/20040101 X-Accept-Language: zh-tw, zh, en-us MIME-Version: 1.0 To: freebsd-questions@FreeBSD.org Content-Type: text/plain; charset=Big5 Content-Transfer-Encoding: 7bit Subject: About contrib/smbfs/lib/smb/nls.c X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jan 2004 12:57:20 -0000 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