emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: file-attribute on certain Chinese filenames failed


From: Eli Zaretskii
Subject: Re: file-attribute on certain Chinese filenames failed
Date: Mon, 19 Feb 2007 00:15:44 +0200

> Date: Sat, 17 Feb 2007 10:09:16 -0500
> From: MJ Chan <address@hidden>
> Cc: address@hidden, address@hidden
> 
> 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 <sys/time.h>
 #include <sys/utime.h>
 
+#include <mbstring.h>
 /* 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;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]