# HG changeset patch # User Eli Zaretskii # Date 1217669368 0 # Node ID 4aa666fb61039ce2264cc08f23b4a4a6af77bf1d # Parent d712a21c7c2a2d784d6745746b2992c1c74ccd1d (Fexpand_file_name): Convert the value of $HOME to a multibyte string. diff -r d712a21c7c2a -r 4aa666fb6103 src/fileio.c --- a/src/fileio.c Fri Aug 01 15:10:50 2008 +0000 +++ b/src/fileio.c Sat Aug 02 09:29:28 2008 +0000 @@ -1066,6 +1066,7 @@ int length; Lisp_Object handler, result; int multibyte; + Lisp_Object hdir; CHECK_STRING (name); @@ -1369,9 +1370,19 @@ #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 = build_string (newdir); + if (!STRING_MULTIBYTE (tem)) + { + hdir = DECODE_FILE (tem); + newdir = SDATA (hdir); + } #ifdef DOS_NT collapse_newdir = 0; #endif