[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: file-attribute on certain Chinese filenames failed
From: |
MJ Chan |
Subject: |
Re: file-attribute on certain Chinese filenames failed |
Date: |
Sun, 18 Feb 2007 23:03:47 -0500 |
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 <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;