Lars Magne Ingebrigtsen <larsi(a)gnus.org> writes:
(file-truename "/music/in/Jóga/")
=>
"/music/in/J\201óga/"
(It really adds just the one character "\201".)
It simply copies the mule encoded data directly before passing it to
the OS. XEmacs elisp may have character type so this doesn't happen
but C does not.
Is this a bug or whot?
Yep. It is even described in the code!
Does this (untested) patch work for you?
Index: fileio.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/fileio.c,v
retrieving revision 1.51.2.9
diff -u -u -r1.51.2.9 fileio.c
--- fileio.c 1999/09/23 07:39:48 1.51.2.9
+++ fileio.c 1999/10/16 12:58:38
@@ -1301,18 +1301,18 @@
{
char resolved_path[MAXPATHLEN];
- char path[MAXPATHLEN];
- char *p = path;
+ char *path;
+ char *p;
int elen = XSTRING_LENGTH (expanded_name);
- if (elen >= countof (path))
+ GET_STRING_FILENAME_DATA_ALLOCA(expanded_name,path,elen);
+ p = path;
+ if (elen > MAXPATHLEN)
goto toolong;
-
- memcpy (path, XSTRING_DATA (expanded_name), elen + 1);
- /* memset (resolved_path, 0, sizeof (resolved_path)); */
-
+
/* Try doing it all at once. */
- /* !!#### Does realpath() Mule-encapsulate? */
+ /* !! Does realpath() Mule-encapsulate?
+ Answer: Nope! So we do it above */
if (!xrealpath (path, resolved_path))
{
/* Didn't resolve it -- have to do it one component at a time. */