From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: MJ Chan Newsgroups: gmane.emacs.devel Subject: Re: file-attribute on certain Chinese filenames failed Date: Sun, 18 Feb 2007 23:03:47 -0500 Message-ID: <17881.8611.694000.409273@MJ.T40.T40> References: <45c9d948.5c6acfa4.4c9b.ffffeb01@mx.google.com> <17873.21871.414000.223392@MJ.T40.T40> <17879.6812.227000.712283@MJ.T40.T40> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1171915227 26332 80.91.229.12 (19 Feb 2007 20:00:27 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 19 Feb 2007 20:00:27 +0000 (UTC) Cc: emacs-devel@gnu.org, handa@m17n.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 19 21:00:19 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 1HJEgM-00054j-Ow for ged-emacs-devel@m.gmane.org; Mon, 19 Feb 2007 21:00:19 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HJEgM-0003Hk-Na for ged-emacs-devel@m.gmane.org; Mon, 19 Feb 2007 15:00:18 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HIzkn-0003ax-Kg for emacs-devel@gnu.org; Sun, 18 Feb 2007 23:03:53 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HIzkl-0003ak-5m for emacs-devel@gnu.org; Sun, 18 Feb 2007 23:03:52 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HIzkl-0003ah-0s for emacs-devel@gnu.org; Sun, 18 Feb 2007 23:03:51 -0500 Original-Received: from c-69-138-161-132.hsd1.md.comcast.net ([69.138.161.132] helo=greenplace.page.us) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_MD5:16) (Exim 4.52) id 1HIzkj-00033s-Pe; Sun, 18 Feb 2007 23:03:49 -0500 Original-Received: from T40 ([127.0.0.1]) by local (greenplace.page.us [127.0.0.1]) (MDaemon.PRO.v6.8.5.R) with ESMTP id 11-md50000000003.tmp; Sun, 18 Feb 2007 23:03:48 -0500 X-Signature: mjchan 1e7039c143c9c7f50ab35a7053107bd9 In-Reply-To: X-Spam-Processed: greenplace.page.us, Sun, 18 Feb 2007 23:03:48 -0500 (not processed: spam filter disabled) X-MDRemoteIP: 127.0.0.1 X-Return-Path: mjchan.inbox@gmail.com X-detected-kernel: Windows 2000 SP2+, XP SP1+ (seldom 98) X-Greylist: delayed 132871 seconds by postgrey-1.27 at monty-python; Sun, 18 Feb 2007 23:03:49 EST X-Mailman-Approved-At: Mon, 19 Feb 2007 15:00:07 -0500 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:66533 Archived-At: Yes, the patch has fixed the problem. Thanks. >>>>> On Monday, February 19 2007, Eli Zaretskii said: >> 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;