comparison src/fileio.c @ 91078:2a54f2cb1b4b

(Fexpand_file_name): Adjust multibyteness of directory and file names.
author Kenichi Handa <handa@m17n.org>
date Fri, 02 Nov 2007 03:18:22 +0000
parents 4bc33ffdda1a
children 56a72e2bd635
comparison
equal deleted inserted replaced
91077:74fda5245f7e 91078:2a54f2cb1b4b
1143 default_directory = Fexpand_file_name (default_directory, Qnil); 1143 default_directory = Fexpand_file_name (default_directory, Qnil);
1144 UNGCPRO; 1144 UNGCPRO;
1145 } 1145 }
1146 1146
1147 name = FILE_SYSTEM_CASE (name); 1147 name = FILE_SYSTEM_CASE (name);
1148 multibyte = STRING_MULTIBYTE (name);
1149 if (multibyte != STRING_MULTIBYTE (default_directory))
1150 {
1151 if (multibyte)
1152 default_directory = string_to_multibyte (default_directory);
1153 else
1154 {
1155 name = string_to_multibyte (name);
1156 multibyte = 1;
1157 }
1158 }
1159
1148 nm = SDATA (name); 1160 nm = SDATA (name);
1149 multibyte = STRING_MULTIBYTE (name);
1150 1161
1151 #ifdef DOS_NT 1162 #ifdef DOS_NT
1152 /* We will force directory separators to be either all \ or /, so make 1163 /* We will force directory separators to be either all \ or /, so make
1153 a local copy to modify, even if there ends up being no change. */ 1164 a local copy to modify, even if there ends up being no change. */
1154 nm = strcpy (alloca (strlen (nm) + 1), nm); 1165 nm = strcpy (alloca (strlen (nm) + 1), nm);
1453 && !index (nm, ':') 1464 && !index (nm, ':')
1454 #endif 1465 #endif
1455 && !newdir) 1466 && !newdir)
1456 { 1467 {
1457 newdir = SDATA (default_directory); 1468 newdir = SDATA (default_directory);
1458 multibyte |= STRING_MULTIBYTE (default_directory);
1459 #ifdef DOS_NT 1469 #ifdef DOS_NT
1460 /* Note if special escape prefix is present, but remove for now. */ 1470 /* Note if special escape prefix is present, but remove for now. */
1461 if (newdir[0] == '/' && newdir[1] == ':') 1471 if (newdir[0] == '/' && newdir[1] == ':')
1462 { 1472 {
1463 is_escaped = 1; 1473 is_escaped = 1;