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

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

[Emacs-bug-tracker] bug#8601: closed (* 2 -> * 4 typo fix in detect_codi


From: GNU bug Tracking System
Subject: [Emacs-bug-tracker] bug#8601: closed (* 2 -> * 4 typo fix in detect_coding_charset)
Date: Fri, 06 May 2011 07:31:02 +0000

Your message dated Fri, 06 May 2011 00:29:56 -0700
with message-id <address@hidden>
and subject line Merged fixes for 8600, 8601, 8602, and (partially) for 8545
has caused the GNU bug report #8601,
regarding * 2 -> * 4 typo fix in detect_coding_charset
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
8601: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8601
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: * 2 -> * 4 typo fix in detect_coding_charset Date: Sun, 01 May 2011 11:19:09 -0700 User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.14) Gecko/20110223 Thunderbird/3.1.8
By code inspection it appears that there's a typo in
detect_coding_charset: an index is multiplied by 2
when it should be multiplied by 4.  By bisecting it
appears that this typo was introduced here:

        revno: 84043 [merge]
        committer: Miles Bader <address@hidden>
        timestamp: Fri 2008-02-01 16:01:31 +0000
        message:
          Merge unicode branch

          Revision: address@hidden/emacs--devo--0--patch-1037

so I'll CC: this to Miles.

Here's a proposed patch.  I haven't tested this, as I don't
have the time to fully understand this code.  But from the
description and other uses of code_space, the "* 2" must be
wrong.

=== modified file 'src/coding.c'
--- src/coding.c        2011-04-29 19:47:29 +0000
+++ src/coding.c        2011-05-01 18:05:21 +0000
@@ -5368,8 +5368,8 @@ detect_coding_charset (struct coding_sys
              if (src == src_end)
                goto too_short;
              ONE_MORE_BYTE (c);
-             if (c < charset->code_space[(dim - 1 - idx) * 2]
-                 || c > charset->code_space[(dim - 1 - idx) * 2 + 1])
+             if (c < charset->code_space[(dim - 1 - idx) * 4]
+                 || c > charset->code_space[(dim - 1 - idx) * 4 + 1])
                break;
            }
          if (idx < dim)





--- End Message ---
--- Begin Message --- Subject: Merged fixes for 8600, 8601, 8602, and (partially) for 8545 Date: Fri, 06 May 2011 00:29:56 -0700 User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110424 Thunderbird/3.1.10
I committed to the Emacs trunk a merge (bzr 104134) that has fixes for
the following bugs:

* Bug#8600 - The fix removes the garbage element of code_space.

* Bug#8601 - Here I assumed that the "* 2" is a typo.

* Bug#8602 - This fixes some large-int-to-float screwups in
             the Lisp reader.

* Bug#8545 - This fixes the bug where the code should have called
             va_copy, but didn't.  Also, I changed a limit so that
             the MOST_POSITIVE_FIXNUM limit for strings applies to
             their length, i.e., does not include the null termination
             byte.  Stefan hasn't had time to chime in, but if this
             last change turns out to be incorrect I will back it out.

This merge doesn't entirely fix Bug#8545, so I'll leave that bug open;
the others I'll close.


--- End Message ---

reply via email to

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