all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: MJ Chan <mjchan.inbox@gmail.com>
Cc: emacs-devel@gnu.org, handa@m17n.org
Subject: Re: file-attribute on certain Chinese filenames failed
Date: Mon, 19 Feb 2007 00:15:44 +0200	[thread overview]
Message-ID: <ud547jenj.fsf@gnu.org> (raw)
In-Reply-To: <17879.6812.227000.712283@MJ.T40.T40> (message from MJ Chan on Sat, 17 Feb 2007 10:09:16 -0500)

> Date: Sat, 17 Feb 2007 10:09:16 -0500
> From: MJ Chan <mjchan.inbox@gmail.com>
> 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 <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	other threads:[~2007-02-18 22:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <45c9d948.5c6acfa4.4c9b.ffffeb01@mx.google.com>
2007-02-13  5:36 ` file-attribute on certain Chinese filenames failed Kenichi Handa
2007-02-13  6:06   ` MJ Chan
2007-02-14 15:15     ` Jason Rumney
2007-02-17 12:22     ` Eli Zaretskii
2007-02-17 15:09       ` MJ Chan
2007-02-18 22:15         ` Eli Zaretskii [this message]
2007-02-19  4:03           ` MJ Chan
2007-02-23 18:41             ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ud547jenj.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=handa@m17n.org \
    --cc=mjchan.inbox@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.