diff options
Diffstat (limited to 'src/casefiddle.c')
| -rw-r--r-- | src/casefiddle.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/casefiddle.c b/src/casefiddle.c index 341e3b313a3..4b38e441cf3 100644 --- a/src/casefiddle.c +++ b/src/casefiddle.c | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | /* GNU Emacs case conversion functions. | 1 | /* GNU Emacs case conversion functions. |
| 2 | Copyright (C) 1985, 1994, 1997 Free Software Foundation, Inc. | 2 | Copyright (C) 1985,94,97,98,99, 2001, 2002, 2004 |
| 3 | Free Software Foundation, Inc. | ||
| 3 | 4 | ||
| 4 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 5 | 6 | ||
| @@ -53,11 +54,19 @@ casify_object (flag, obj) | |||
| 53 | int flags = XINT (obj) & flagbits; | 54 | int flags = XINT (obj) & flagbits; |
| 54 | int multibyte = ! NILP (current_buffer->enable_multibyte_characters); | 55 | int multibyte = ! NILP (current_buffer->enable_multibyte_characters); |
| 55 | 56 | ||
| 57 | /* If the character has higher bits set | ||
| 58 | above the flags, return it unchanged. | ||
| 59 | It is not a real character. */ | ||
| 60 | if ((unsigned) XFASTINT (obj) > (unsigned) flagbits) | ||
| 61 | return obj; | ||
| 62 | |||
| 56 | c1 = XFASTINT (obj) & ~flagbits; | 63 | c1 = XFASTINT (obj) & ~flagbits; |
| 57 | if (! multibyte) | 64 | if (! multibyte) |
| 58 | MAKE_CHAR_MULTIBYTE (c1); | 65 | MAKE_CHAR_MULTIBYTE (c1); |
| 59 | c = DOWNCASE (c1); | 66 | c = DOWNCASE (c1); |
| 60 | if (inword || c == c1) | 67 | if (inword) |
| 68 | XSETFASTINT (obj, c | flags); | ||
| 69 | else if (c == (XFASTINT (obj) & ~flagbits)) | ||
| 61 | { | 70 | { |
| 62 | if (! inword) | 71 | if (! inword) |
| 63 | c = UPCASE1 (c1); | 72 | c = UPCASE1 (c1); |