summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2014-03-25 22:35:38 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2014-03-25 22:35:38 -0700
commit05b250c2c0063fadbfc345ee0866da0fd846f939 (patch)
treee594871394cd6dc2a30a8d20f8eeafd73598a296 /src
parentcefcfbcc1b7865dafd615c0fe42e62dbe2660ddd (diff)
downloademacs-05b250c2c0063fadbfc345ee0866da0fd846f939.tar.gz
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')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/editfns.c15
2 files changed, 10 insertions, 10 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 72d9f60002a..bf27ece6af7 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,10 @@
2014-03-26 Paul Eggert <eggert@cs.ucla.edu>
+ Fix core dump in char-equal (Bug#17011).
+ * editfns.c (Fchar_equal): Do not use MAKE_CHAR_MULTIBYTE in
+ unibyte buffers, as we can't tell whether the characters are
+ actually unibyte.
+
* insdel.c (adjust_markers_for_delete): Remove unused local.
2014-03-24 Barry O'Reilly <gundaetiapo@gmail.com>
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. */)
if (NILP (BVAR (current_buffer, case_fold_search)))
return Qnil;
+ /* FIXME: When enable-multibyte-characters is nil, it's still possible
+ to manipulate multibyte chars, which means there is a bug for chars
+ in the range 128-255 as we can't tell whether they are eight-bit
+ bytes or Latin-1 chars. For now, assume the latter. See Bug#17011.
+ Also see casefiddle.c's casify_object, which has a similar problem. */
i1 = XFASTINT (c1);
- if (NILP (BVAR (current_buffer, enable_multibyte_characters))
- && ! ASCII_CHAR_P (i1))
- {
- MAKE_CHAR_MULTIBYTE (i1);
- }
i2 = XFASTINT (c2);
- if (NILP (BVAR (current_buffer, enable_multibyte_characters))
- && ! ASCII_CHAR_P (i2))
- {
- MAKE_CHAR_MULTIBYTE (i2);
- }
return (downcase (i1) == downcase (i2) ? Qt : Qnil);
}