From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: file-attribute on certain Chinese filenames failed Date: Mon, 19 Feb 2007 00:15:44 +0200 Message-ID: References: <45c9d948.5c6acfa4.4c9b.ffffeb01@mx.google.com> <17873.21871.414000.223392@MJ.T40.T40> <17879.6812.227000.712283@MJ.T40.T40> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: sea.gmane.org 1171836962 14987 80.91.229.12 (18 Feb 2007 22:16:02 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 18 Feb 2007 22:16:02 +0000 (UTC) Cc: emacs-devel@gnu.org, handa@m17n.org To: MJ Chan Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Feb 18 23:15:56 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HIuK3-00048U-Ll for ged-emacs-devel@m.gmane.org; Sun, 18 Feb 2007 23:15:55 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HIuK3-0001Zu-4f for ged-emacs-devel@m.gmane.org; Sun, 18 Feb 2007 17:15:55 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HIuJs-0001Zo-4b for emacs-devel@gnu.org; Sun, 18 Feb 2007 17:15:44 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HIuJp-0001Zc-QG for emacs-devel@gnu.org; Sun, 18 Feb 2007 17:15:42 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HIuJp-0001ZZ-KN for emacs-devel@gnu.org; Sun, 18 Feb 2007 17:15:41 -0500 Original-Received: from heller.inter.net.il ([213.8.233.23]) by monty-python.gnu.org with esmtp (Exim 4.52) id 1HIuJp-00019w-7V for emacs-devel@gnu.org; Sun, 18 Feb 2007 17:15:41 -0500 Original-Received: from HOME-C4E4A596F7 (IGLD-80-230-15-157.inter.net.il [80.230.15.157]) by heller.inter.net.il (MOS 3.7.3a-GA) with ESMTP id BXB68368 (AUTH halo1); Mon, 19 Feb 2007 00:15:33 +0200 (IST) In-reply-to: <17879.6812.227000.712283@MJ.T40.T40> (message from MJ Chan on Sat, 17 Feb 2007 10:09:16 -0500) X-detected-kernel: FreeBSD 4.7-5.2 (or MacOS X 10.2-10.4) (2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:66515 Archived-At: > Date: Sat, 17 Feb 2007 10:09:16 -0500 > From: MJ Chan > Cc: handa@m17n.org, emacs-devel@gnu.org > > Indeed, the problem is in stat, which calls strpbrk for checking > invalid filename, (*?|<>\"). The Chinese/Big5 character that I have > problem with contains '|'. Thanks for pointing out this blunder. Does the patch below fix the problem for you with Chinese file names? Index: src/w32.c =================================================================== RCS file: /cvsroot/emacs/emacs/src/w32.c,v retrieving revision 1.110 diff -u -r1.110 w32.c --- src/w32.c 21 Jan 2007 04:18:15 -0000 1.110 +++ src/w32.c 18 Feb 2007 22:13:58 -0000 @@ -33,6 +33,7 @@ #include #include +#include /* must include CRT headers *before* config.h */ #ifdef HAVE_CONFIG_H @@ -2387,7 +2388,7 @@ name = (char *) map_w32_filename (path, &path); /* must be valid filename, no wild cards or other invalid characters */ - if (strpbrk (name, "*?|<>\"")) + if (_mbspbrk (name, "*?|<>\"")) { errno = ENOENT; return -1;