]> git.eshelyaron.com Git - emacs.git/commitdiff
(casify_object): Cope with modifier bits in character.
authorKarl Heuer <kwzh@gnu.org>
Thu, 18 Jun 1998 04:11:28 +0000 (04:11 +0000)
committerKarl Heuer <kwzh@gnu.org>
Thu, 18 Jun 1998 04:11:28 +0000 (04:11 +0000)
src/casefiddle.c

index b6d8b21f606674cf31ca72bc2d9f0d856ccbf7fc..65fc4f0d80a7ad15fb4daefe602b7417d2b0b3d3 100644 (file)
@@ -47,13 +47,17 @@ casify_object (flag, obj)
     {
       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;
        }