(Fexpand_file_name): Convert the value of $HOME to a multibyte string.
authorEli Zaretskii <eliz@gnu.org>
Sat, 29 Mar 2008 13:53:02 +0000 (13:53 +0000)
committerEli Zaretskii <eliz@gnu.org>
Sat, 29 Mar 2008 13:53:02 +0000 (13:53 +0000)
src/ChangeLog
src/fileio.c

index 33c1b32..c7f52c3 100644 (file)
@@ -1,3 +1,8 @@
+2008-03-29  Eli Zaretskii  <eliz@gnu.org>
+
+       * fileio.c (Fexpand_file_name): Convert the value of $HOME to a
+       multibyte string.
+
 2008-03-29  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * keyboard.c (pending_funcalls): New var.
index fe05cf9..2af8124 100644 (file)
@@ -1378,9 +1378,15 @@ See also the function `substitute-in-file-name'.  */)
 #endif /* VMS */
          || nm[1] == 0)        /* ~ by itself */
        {
+         Lisp_Object tem;
+
          if (!(newdir = (unsigned char *) egetenv ("HOME")))
            newdir = (unsigned char *) "";
          nm++;
+         /* egetenv may return a unibyte string, which will bite us since
+            we expect the directory to be multibyte.  */
+         tem = string_to_multibyte (build_string (newdir));
+         newdir = SDATA (tem);
 #ifdef DOS_NT
          collapse_newdir = 0;
 #endif