From 205be0810af6814de7ca6fc57391bbd5096339aa Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 28 Oct 2014 19:48:21 +0200 Subject: [PATCH] Fix bug #18873 with non-ASCII characters in user's HOME directory. src/fileio.c (Fexpand_file_name): Use make_unibyte_string, not build_string, when importing a home directory. --- src/ChangeLog | 5 +++++ src/fileio.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index da3e4d682d5..33ee723fe66 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2014-10-28 Eli Zaretskii + + * fileio.c (Fexpand_file_name): Use make_unibyte_string, not + build_string, when importing a home directory. (Bug#18873) + 2014-10-26 Eli Zaretskii * dispnew.c (buffer_posn_from_coords): Use diff --git a/src/fileio.c b/src/fileio.c index b4653017b28..fba64010b54 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -1166,7 +1166,7 @@ filesystem tree, not (expand-file-name ".." dirname). */) char newdir_utf8[MAX_UTF8_PATH]; filename_from_ansi (newdir, newdir_utf8); - tem = build_string (newdir_utf8); + tem = make_unibyte_string (newdir_utf8, strlen (newdir_utf8)); } else #endif @@ -1200,7 +1200,7 @@ filesystem tree, not (expand-file-name ".." dirname). */) /* `getpwnam' may return a unibyte string, which will bite us since we expect the directory to be multibyte. */ - tem = build_string (newdir); + tem = make_unibyte_string (newdir, strlen (newdir)); if (multibyte && !STRING_MULTIBYTE (tem)) { hdir = DECODE_FILE (tem); -- 2.39.5