changeset 24572:9fb4096c5f77

(Faccessible_keymaps): Really initialize i_byte. Convert 0200 to meta only in a unibyte string. (Fkey_description): Likewise.
author Richard M. Stallman <rms@gnu.org>
date Tue, 06 Apr 1999 19:36:02 +0000
parents 9944f4ca2ee5
children aa24b1cb428a
files src/keymap.c
diffstat 1 files changed, 14 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/src/keymap.c	Tue Apr 06 19:06:27 1999 +0000
+++ b/src/keymap.c	Tue Apr 06 19:36:02 1999 +0000
@@ -1472,15 +1472,17 @@
 	      Lisp_Object copy;
 
 	      copy = Fmake_vector (make_number (XSTRING (prefix)->size), Qnil);
-	      for (i = 0, i_byte; i < XSTRING (prefix)->size;)
+	      for (i = 0, i_byte = 0; i < XSTRING (prefix)->size;)
 		{
 		  int i_before = i;
 		  if (STRING_MULTIBYTE (prefix))
 		    FETCH_STRING_CHAR_ADVANCE (c, prefix, i, i_byte);
 		  else
-		    c = XSTRING (prefix)->data[i++];
-		  if (c & 0200)
-		    c ^= 0200 | meta_modifier;
+		    {
+		      c = XSTRING (prefix)->data[i++];
+		      if (c & 0200)
+			c ^= 0200 | meta_modifier;
+		    }
 		  XVECTOR (copy)->contents[i_before] = make_number (c);
 		}
 	      prefix = copy;
@@ -1704,7 +1706,7 @@
     {
       Lisp_Object vector;
       vector = Fmake_vector (Flength (keys), Qnil);
-      for (i = 0; i < XSTRING (keys)->size; )
+      for (i = 0, i_byte = 0; i < XSTRING (keys)->size; )
 	{
 	  int c;
 	  int i_before = i;
@@ -1712,13 +1714,13 @@
 	  if (STRING_MULTIBYTE (keys))
 	    FETCH_STRING_CHAR_ADVANCE (c, keys, i, i_byte);
 	  else
-	    c = XSTRING (keys)->data[i++];
-
-	  if (c & 0x80)
-	    XSETFASTINT (XVECTOR (vector)->contents[i_before],
-			 meta_modifier | (c & ~0x80));
-	  else
-	    XSETFASTINT (XVECTOR (vector)->contents[i_before], c);
+	    {
+	      c = XSTRING (keys)->data[i++];
+	      if (c & 0200)
+		c ^= 0200 | meta_modifier;
+	    }
+
+	  XSETFASTINT (XVECTOR (vector)->contents[i_before], c);
 	}
       keys = vector;
     }