diff src/keymap.c @ 37864:db3e294b4ce2

*** empty log message ***
author Gerd Moellmann <gerd@gnu.org>
date Tue, 29 May 2001 11:10:47 +0000
parents e5c590c9fe66
children fdd419d4776a
line wrap: on
line diff
--- a/src/keymap.c	Tue May 29 08:56:24 2001 +0000
+++ b/src/keymap.c	Tue May 29 11:10:47 2001 +0000
@@ -1959,14 +1959,18 @@
 	}
       else
 	{
-	  char tem[KEY_DESCRIPTION_SIZE];
-	  int len;
-
-	  *push_key_description (XUINT (key), tem, 1) = 0;
-	  len = strlen (tem);
-	  return make_multibyte_string (tem,
-					multibyte_chars_in_text (tem, len),
-					len);
+	  char tem[KEY_DESCRIPTION_SIZE], *end;
+	  int nbytes, nchars;
+	  Lisp_Object string;
+
+	  end = push_key_description (XUINT (key), tem, 1);
+	  nbytes = end - tem;
+	  nchars = multibyte_chars_in_text (tem, nbytes);
+	  if (nchars == nbytes)
+	    string = build_string (tem);
+	  else
+	    string = make_multibyte_string (tem, nchars, nbytes);
+	  return string;
 	}
     }
   else if (SYMBOLP (key))	/* Function key or event-symbol */