Mercurial > emacs
comparison src/fileio.c @ 80664:4aa666fb6103
(Fexpand_file_name): Convert the value of $HOME to a multibyte string.
author | Eli Zaretskii <eliz@gnu.org> |
---|---|
date | Sat, 02 Aug 2008 09:29:28 +0000 |
parents | df2738e4f7ad |
children | 0122e7498e18 |
comparison
equal
deleted
inserted
replaced
80663:d712a21c7c2a | 80664:4aa666fb6103 |
---|---|
1064 int is_escaped = 0; | 1064 int is_escaped = 0; |
1065 #endif /* DOS_NT */ | 1065 #endif /* DOS_NT */ |
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 |
1072 /* If the file name has special constructs in it, | 1073 /* If the file name has special constructs in it, |
1073 call the corresponding file handler. */ | 1074 call the corresponding file handler. */ |
1367 #ifdef VMS | 1368 #ifdef VMS |
1368 || nm[1] == ':' | 1369 || nm[1] == ':' |
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 |
1378 #ifdef VMS | 1389 #ifdef VMS |
1379 nm++; /* Don't leave the slash in nm. */ | 1390 nm++; /* Don't leave the slash in nm. */ |