changeset 2892:7ff263825550

(follow_key): Check char in range before UPPERCASEP.
author Richard M. Stallman <rms@gnu.org>
date Wed, 19 May 1993 04:58:19 +0000
parents c10bb302a315
children 4df57953d5d0
files src/keyboard.c
diffstat 1 files changed, 15 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/keyboard.c	Wed May 19 04:56:06 1993 +0000
+++ b/src/keyboard.c	Wed May 19 04:58:19 1993 +0000
@@ -2095,17 +2095,21 @@
 	if (event->modifiers & ctrl_modifier)
 	  {
 	    if (c >= 0100 && c < 0140)
-	      c &= ~040;
+	      {
+		int oc = c;
+		c &= ~0140;
+		/* Set the shift modifier for a control char
+		   made from a shifted letter.  But only for letters!  */
+		if (oc >= 'A' && oc <= 'Z')
+		  c |= shift_modifier;
+	      }
+	    else if (c >= 'a' && c <= 'z')
+	      c &= ~0140;
 	    /* Include the bits for control and shift
 	       only if the basic ASCII code can't indicate them.  */
-	    c |= ctrl_modifier;
+	    else
+	      c |= ctrl_modifier;
 	  }
-	/* Set the shift modifier for a control char
-	   made from a shifted letter.  But only for letters!  */
-	if (XFASTINT (event->code) >= 'A' - 0100
-	    && XFASTINT (event->code) <= 'Z' - 0100
-	    && (event->modifiers & shift_modifier))
-	  c |= shift_modifier;
 	c |= (event->modifiers
 	      & (meta_modifier | alt_modifier
 		 | hyper_modifier | super_modifier));
@@ -3389,7 +3393,9 @@
      lower-case letter, return the bindings for the lower-case letter.  */
   if (first_binding == nmaps
       && XTYPE (key) == Lisp_Int
-      && (UPPERCASEP (XINT (key) & 0x3ffff)
+      && ((((XINT (key) & 0x3ffff)
+	    < XSTRING (current_buffer->downcase_table)->size)
+	   && UPPERCASEP (XINT (key) & 0x3ffff))
 	  || (XINT (key) & shift_modifier)))
     {
       if (XINT (key) & shift_modifier)