diff options
| author | Eli Zaretskii | 2008-08-02 09:31:21 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2008-08-02 09:31:21 +0000 |
| commit | 8fe2123ed131e431097b755900b3b7adfe68ab9b (patch) | |
| tree | 1460b827f35abdf096d5d08ffdf7aecb0f5b7173 /src | |
| parent | f5c3336520627d95da2efb971350bfdd151a3a57 (diff) | |
| download | emacs-8fe2123ed131e431097b755900b3b7adfe68ab9b.tar.gz emacs-8fe2123ed131e431097b755900b3b7adfe68ab9b.zip | |
(Fexpand_file_name): Convert the value of $HOME to a multibyte string.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/fileio.c | 11 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 4e41e9be455..5d190d543c2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2008-08-02 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * fileio.c (Fexpand_file_name): Convert the value of $HOME to a | ||
| 4 | multibyte string. | ||
| 5 | |||
| 1 | 2008-08-01 Jason Rumney <jasonr@gnu.org> | 6 | 2008-08-01 Jason Rumney <jasonr@gnu.org> |
| 2 | 7 | ||
| 3 | * w32term.c (x_draw_composite_glyph_string_foreground): Force | 8 | * w32term.c (x_draw_composite_glyph_string_foreground): Force |
diff --git a/src/fileio.c b/src/fileio.c index cc6c7c2d3a7..4f703a8a743 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -1066,6 +1066,7 @@ See also the function `substitute-in-file-name'. */) | |||
| 1066 | int length; | 1066 | int length; |
| 1067 | Lisp_Object handler, result; | 1067 | Lisp_Object handler, result; |
| 1068 | int multibyte; | 1068 | int multibyte; |
| 1069 | Lisp_Object hdir; | ||
| 1069 | 1070 | ||
| 1070 | CHECK_STRING (name); | 1071 | CHECK_STRING (name); |
| 1071 | 1072 | ||
| @@ -1369,9 +1370,19 @@ See also the function `substitute-in-file-name'. */) | |||
| 1369 | #endif /* VMS */ | 1370 | #endif /* VMS */ |
| 1370 | || nm[1] == 0) /* ~ by itself */ | 1371 | || nm[1] == 0) /* ~ by itself */ |
| 1371 | { | 1372 | { |
| 1373 | Lisp_Object tem; | ||
| 1374 | |||
| 1372 | if (!(newdir = (unsigned char *) egetenv ("HOME"))) | 1375 | if (!(newdir = (unsigned char *) egetenv ("HOME"))) |
| 1373 | newdir = (unsigned char *) ""; | 1376 | newdir = (unsigned char *) ""; |
| 1374 | nm++; | 1377 | nm++; |
| 1378 | /* egetenv may return a unibyte string, which will bite us since | ||
| 1379 | we expect the directory to be multibyte. */ | ||
| 1380 | tem = build_string (newdir); | ||
| 1381 | if (!STRING_MULTIBYTE (tem)) | ||
| 1382 | { | ||
| 1383 | hdir = DECODE_FILE (tem); | ||
| 1384 | newdir = SDATA (hdir); | ||
| 1385 | } | ||
| 1375 | #ifdef DOS_NT | 1386 | #ifdef DOS_NT |
| 1376 | collapse_newdir = 0; | 1387 | collapse_newdir = 0; |
| 1377 | #endif | 1388 | #endif |