bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#17011: 24.3.50; Random Emacs crash when opening image/pdf files from


From: Eli Zaretskii
Subject: bug#17011: 24.3.50; Random Emacs crash when opening image/pdf files from magit.
Date: Wed, 26 Mar 2014 17:19:36 +0200

> Date: Tue, 25 Mar 2014 22:42:38 -0700
> From: Paul Eggert <eggert@cs.ucla.edu>
> Cc: 17011@debbugs.gnu.org
> 
> Thanks, with that backtrace I reproduced the core dump as follows:
> 
> Build emacs with -DENABLE_CHECKING in CFLAGS.
> ./emacs -Q
> M-x find-file-literally RET somefile RET
> M-x set-var RET case-fold-search RET t RET
> M-: (char-equal 270 300) RET
> 
> I installed a patch as emacs-24 bzr 116863, which worked for me; please 
> give it a try.
> 
> http://bzr.savannah.gnu.org/lh/emacs/emacs-24/revision/116863

That's a backward-incompatible change: it changes behavior for those
eight-bit bytes that are now interpreted as Latin letters.  I don't
think we should make incompatible changes on the release branch (or at
all) in this case.

I suggest the following compatible change (the diffs are relative to
the emacs-24 sources before r116833):

--- src/editfns.c~0     2014-01-26 07:13:31 +0200
+++ src/editfns.c       2014-03-26 10:14:31 +0200
@@ -4378,16 +4378,19 @@ Case is ignored if `case-fold-search' is
     return Qnil;
 
   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))
+  if (NILP (BVAR (current_buffer, enable_multibyte_characters)))
     {
-      MAKE_CHAR_MULTIBYTE (i2);
+      /* It should still be possible to compare multibyte characters
+        even though the current buffer is unibyte (see bug#17011).
+        This causes dilemma wrt characters between 128 and 255 --
+        they could be either eight-bit raw bytes or Latin-1
+        characters.  We resolve this dilemma here in favor of
+        eight-bit bytes, since we are in a unibyte buffer.  */
+      if (! ASCII_CHAR_P (i1) && i1 < 0x0100)
+       MAKE_CHAR_MULTIBYTE (i1);
+      if (! ASCII_CHAR_P (i2) && i2 < 0x0100)
+       MAKE_CHAR_MULTIBYTE (i2);
     }
   return (downcase (i1) == downcase (i2) ? Qt :  Qnil);
 }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]