changeset 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 eebcd044d7bc
children 3c5b3356d8e5
files src/fileio.c
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/fileio.c	Mon Sep 27 11:02:42 2004 +0000
+++ b/src/fileio.c	Tue Sep 28 04:37:26 2004 +0000
@@ -256,9 +256,12 @@
 {
   Lisp_Object errstring;
   int errorno = errno;
+  char *str;
 
   synchronize_system_messages_locale ();
-  errstring = code_convert_string_norecord (build_string (strerror (errorno)),
+  str = strerror (errorno);
+  errstring = code_convert_string_norecord (make_unibyte_string (str,
+								 strlen (str)),
 					    Vlocale_coding_system, 0);
 
   while (1)
@@ -2251,7 +2254,8 @@
 	       convert what we substitute into multibyte.  */
 	    while (*o)
 	      {
-		int c = unibyte_char_to_multibyte (*o++);
+		int c = unibyte_char_to_multibyte (*o);
+		o++;
 		x += CHAR_STRING (c, x);
 	      }
 	  }