From 6d5577783e2e909808280438eae1c2d6293fdf34 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 29 Mar 2008 13:53:02 +0000 Subject: [PATCH] (Fexpand_file_name): Convert the value of $HOME to a multibyte string. --- src/ChangeLog | 5 +++++ src/fileio.c | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 33c1b324e9..c7f52c3dd6 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2008-03-29 Eli Zaretskii + + * fileio.c (Fexpand_file_name): Convert the value of $HOME to a + multibyte string. + 2008-03-29 Stefan Monnier * keyboard.c (pending_funcalls): New var. diff --git a/src/fileio.c b/src/fileio.c index fe05cf9d44..2af8124a85 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -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 -- 2.20.1