aboutsummaryrefslogtreecommitdiffstats
path: root/src/editfns.c
diff options
context:
space:
mode:
authorPaul Eggert2014-03-25 22:35:38 -0700
committerPaul Eggert2014-03-25 22:35:38 -0700
commit05b250c2c0063fadbfc345ee0866da0fd846f939 (patch)
treee594871394cd6dc2a30a8d20f8eeafd73598a296 /src/editfns.c
parentcefcfbcc1b7865dafd615c0fe42e62dbe2660ddd (diff)
downloademacs-05b250c2c0063fadbfc345ee0866da0fd846f939.tar.gz
emacs-05b250c2c0063fadbfc345ee0866da0fd846f939.zip
Fix core dump in char-equal.
* editfns.c (Fchar_equal): Do not use MAKE_CHAR_MULTIBYTE in unibyte buffers, as we can't tell whether the characters are actually unibyte. Fixes: debbugs:17011
Diffstat (limited to 'src/editfns.c')
-rw-r--r--src/editfns.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/editfns.c b/src/editfns.c
index 5018020a11b..1986ee53d23 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -4377,18 +4377,13 @@ Case is ignored if `case-fold-search' is non-nil in the current buffer. */)
4377 if (NILP (BVAR (current_buffer, case_fold_search))) 4377 if (NILP (BVAR (current_buffer, case_fold_search)))
4378 return Qnil; 4378 return Qnil;
4379 4379
4380 /* FIXME: When enable-multibyte-characters is nil, it's still possible
4381 to manipulate multibyte chars, which means there is a bug for chars
4382 in the range 128-255 as we can't tell whether they are eight-bit
4383 bytes or Latin-1 chars. For now, assume the latter. See Bug#17011.
4384 Also see casefiddle.c's casify_object, which has a similar problem. */
4380 i1 = XFASTINT (c1); 4385 i1 = XFASTINT (c1);
4381 if (NILP (BVAR (current_buffer, enable_multibyte_characters))
4382 && ! ASCII_CHAR_P (i1))
4383 {
4384 MAKE_CHAR_MULTIBYTE (i1);
4385 }
4386 i2 = XFASTINT (c2); 4386 i2 = XFASTINT (c2);
4387 if (NILP (BVAR (current_buffer, enable_multibyte_characters))
4388 && ! ASCII_CHAR_P (i2))
4389 {
4390 MAKE_CHAR_MULTIBYTE (i2);
4391 }
4392 return (downcase (i1) == downcase (i2) ? Qt : Qnil); 4387 return (downcase (i1) == downcase (i2) ? Qt : Qnil);
4393} 4388}
4394 4389