GNU bug report logs - #8601
* 2 -> * 4 typo fix in detect_coding_charset

Previous Next

Package: emacs;

Reported by: Paul Eggert <eggert <at> cs.ucla.edu>

Date: Sun, 1 May 2011 18:20:03 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 8601 in the body.
You can then email your comments to 8601 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8601; Package emacs. (Sun, 01 May 2011 18:20:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Paul Eggert <eggert <at> cs.ucla.edu>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 01 May 2011 18:20:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: bug-gnu-emacs <at> gnu.org
Cc: Miles Bader <miles <at> gnu.org>
Subject: * 2 -> * 4 typo fix in detect_coding_charset
Date: Sun, 01 May 2011 11:19:09 -0700
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 <miles <at> gnu.org>
	timestamp: Fri 2008-02-01 16:01:31 +0000
	message:
	  Merge unicode branch

	  Revision: emacs <at> sv.gnu.org/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)






Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8601; Package emacs. (Sun, 01 May 2011 19:08:01 GMT) Full text and rfc822 format available.

Message #8 received at 8601 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 8601 <at> debbugs.gnu.org, Miles Bader <miles <at> gnu.org>
Subject: Re: bug#8601: * 2 -> * 4 typo fix in detect_coding_charset
Date: Sun, 01 May 2011 21:06:59 +0200
Paul Eggert <eggert <at> cs.ucla.edu> writes:

> 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]

Except that a merge commit is never adequate for infering blame.  See
e209e347 for the real source.

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8601; Package emacs. (Sun, 01 May 2011 19:26:02 GMT) Full text and rfc822 format available.

Message #11 received at 8601 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: 8601 <at> debbugs.gnu.org, Miles Bader <miles <at> gnu.org>
Subject: Re: bug#8601: * 2 -> * 4 typo fix in detect_coding_charset
Date: Sun, 01 May 2011 12:25:36 -0700
On 05/01/11 12:06, Andreas Schwab wrote:
> Except that a merge commit is never adequate for infering blame.  See
> e209e347 for the real source.

OK, thanks, I'll CC: this to Kenichi Handa, who made the
original change back on 2006-11-08 04:28:29 +0000
(revno 52413.1.1170 in the trunk).  Kenichi, can you please
take a look at
<http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8601>?
Thanks.

PS.  Sorry, I don't know what "e209e347" means; is there some
documentation for that notation?




Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Fri, 06 May 2011 07:31:02 GMT) Full text and rfc822 format available.

Notification sent to Paul Eggert <eggert <at> cs.ucla.edu>:
bug acknowledged by developer. (Fri, 06 May 2011 07:31:03 GMT) Full text and rfc822 format available.

Message #16 received at 8601-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: 8545 <at> debbugs.gnu.org, 8600-done <at> debbugs.gnu.org, 
	8601-done <at> debbugs.gnu.org, 8602-done <at> debbugs.gnu.org
Subject: Merged fixes for 8600, 8601, 8602, and (partially) for 8545
Date: Fri, 06 May 2011 00:29:56 -0700
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.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 03 Jun 2011 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 12 years and 352 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.