changeset 22506:2107e25fa56f

(casify_object): Cope with modifier bits in character.
author Karl Heuer <kwzh@gnu.org>
date Thu, 18 Jun 1998 04:11:28 +0000
parents d4f3552a85f2
children f189183483a2
files src/casefiddle.c
diffstat 1 files changed, 9 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/casefiddle.c	Wed Jun 17 04:22:58 1998 +0000
+++ b/src/casefiddle.c	Thu Jun 18 04:11:28 1998 +0000
@@ -47,13 +47,17 @@
     {
       if (INTEGERP (obj))
 	{
-	  c = DOWNCASE (XFASTINT (obj));
+	  int flagbits = (CHAR_ALT | CHAR_SUPER | CHAR_HYPER
+			  | CHAR_SHIFT | CHAR_CTL | CHAR_META);
+	  int flags = XINT (obj) & flagbits;
+
+	  c = DOWNCASE (XFASTINT (obj) & ~flagbits);
 	  if (inword)
-	    XSETFASTINT (obj, c);
-	  else if (c == XFASTINT (obj))
+	    XSETFASTINT (obj, c | flags);
+	  else if (c == (XFASTINT (obj) & ~flagbits))
 	    {
-	      c = UPCASE1 (XFASTINT (obj));
-	      XSETFASTINT (obj, c);
+	      c = UPCASE1 ((XFASTINT (obj) & ~flagbits));
+	      XSETFASTINT (obj, c | flags);
 	    }
 	  return obj;
 	}