comparison src/fileio.c @ 89987:d7211599ad16

(report_file_error): Make a unibyte string from strerror (errorno). (Fsubstitute_in_file_name): Fix the arg to unibyte_char_to_multibyte. It is evaluated twice.
author Kenichi Handa <handa@m17n.org>
date Tue, 28 Sep 2004 04:37:26 +0000
parents 566253900690
children 58db929d96c6
comparison
equal deleted inserted replaced
89986:eebcd044d7bc 89987:d7211599ad16
254 const char *string; 254 const char *string;
255 Lisp_Object data; 255 Lisp_Object data;
256 { 256 {
257 Lisp_Object errstring; 257 Lisp_Object errstring;
258 int errorno = errno; 258 int errorno = errno;
259 char *str;
259 260
260 synchronize_system_messages_locale (); 261 synchronize_system_messages_locale ();
261 errstring = code_convert_string_norecord (build_string (strerror (errorno)), 262 str = strerror (errorno);
263 errstring = code_convert_string_norecord (make_unibyte_string (str,
264 strlen (str)),
262 Vlocale_coding_system, 0); 265 Vlocale_coding_system, 0);
263 266
264 while (1) 267 while (1)
265 switch (errorno) 268 switch (errorno)
266 { 269 {
2249 { 2252 {
2250 /* If the original string is multibyte, 2253 /* If the original string is multibyte,
2251 convert what we substitute into multibyte. */ 2254 convert what we substitute into multibyte. */
2252 while (*o) 2255 while (*o)
2253 { 2256 {
2254 int c = unibyte_char_to_multibyte (*o++); 2257 int c = unibyte_char_to_multibyte (*o);
2258 o++;
2255 x += CHAR_STRING (c, x); 2259 x += CHAR_STRING (c, x);
2256 } 2260 }
2257 } 2261 }
2258 else 2262 else
2259 { 2263 {